home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / db_fullf / eb111.zip / PACK1.PRG / EBOUT / EB2.REP (.txt) < prev    next >
PC-File  |  1997-01-21  |  176KB  |  3,248 lines

  1.                           EASY BASE USERS MANUAL
  2.                           
  3.                                 Contents
  4.                                 
  5.             System Overview..............................   1
  6.             Data Management Principles...................   2
  7.             Form Design..................................   6
  8.             Relationships and Lookups....................  11
  9.             Data Entry...................................  15
  10.             Procedures (Reporting).......................  20
  11.             Procedures (Transactional)...................  36
  12.             User Menus...................................  39
  13.             External File Access.........................  43
  14.             Data File Format.............................  45
  15.             System Requirements and Limitations..........  46
  16.             DOS Filename Convention......................  47
  17.             Selected Programming Topics..................  49
  18.       Easy Base is copyright (c) John Turnbull 1994 published by:-
  19.       Easy Software                  Tel/FAX (044) (0) 1625 614669
  20.       3 Brookside Court              CIS 100410,717
  21.       Prestbury Road
  22.       Macclesfield
  23.       SK10 3BR
  24.       UK
  25. ................................................................................
  26.                                TERMINOLOGY
  27.                                
  28.      Field          The storage space for an individual data item.
  29.      
  30.      Record         A set of related data items.
  31.      
  32.      Form           The storage space for a set of records.
  33.      
  34.      Procedure      A set of instructions which manipulate the data
  35.      
  36.       stored in forms.
  37.      Relationship   A record in the relationships form recording
  38.      
  39.    a link between forms.
  40. ................................................................................
  41.                       EASY BASE SYSTEM OVERVIEW
  42.      Easy Base is a complete rapid programming system for data
  43.      management. Virtually every data management problem can be
  44.      broken down into three areas. Creating disk files (referred to
  45.      as "Forms" in Easy Base) in which to store data, creating
  46.      procedures which manipulate that data and presenting those
  47.      forms and procedures in a logical menu system for use.
  48.      In Easy Base you create the forms in which to store data in a
  49.      simple screen-painting environment which not only designs the
  50.      data file but at the same time provides a default data entry
  51.      screen for your data. As you place the "Fields" in which data
  52.      is to be stored you can use relational links ("Lookups") to
  53.      import data from other forms. Each field you create for data
  54.      storage is also treated as a deriveable "Cell" similar to a
  55.      spread sheet. You can make almost any calculation or derivation
  56.      within a field as, apart from all arithmetic, relational and
  57.      logical operators, Easy Base also provides a set of over fifty
  58.      functions covering everything from Modulo arithmetic to
  59.      spelling out dates. Once you have created your forms you can
  60.      use the default screen to enter and view your data using the
  61.      "Data Entry" system.
  62.      Once you have data stored you will need to be able to
  63.      manipulate it and report on it. Easy Base provides a combined
  64.      transaction and reporting system ("Procedure Generator"). With
  65.      the procedure generator you can use the default screens you
  66.      have designed or create custom screens in which to gather input
  67.      either from the keyboard or from relational Lookups. You then
  68.      instruct Easy Base what to do with this information using a
  69.      simple "Basic" like programming language. If your procedure is
  70.      transactional you have commands to enter, modify or delete
  71.      records in any number of forms within a single procedure. If
  72.      your procedure is reporting then there are commands to group,
  73.      order and list data in almost every conceivable way.
  74.      You now have all the "Parts" required to create a useful data
  75.      management program. All that remains is to tie your procedures
  76.      to a menu system so that other people can use your application
  77.      without having to know anything about Easy Base. Creating an
  78.      end user menu system in Easy base is as simple as filling in a
  79.      form with the text you wish to display and the procedure or
  80.      form you wish to run. You give at least one of your menus a
  81.      start up password. If you then restart Easy Base but sign on
  82.      with that password instead of your developers password then you
  83.      will be running your own custom designed program.
  84.                                  - 1 -
  85. ................................................................................
  86.                      DATA MANAGEMENT PRINCIPLES
  87.      In Easy Base, creating forms and entering data is very easy.
  88.      You will be tempted to rush on and create programs for yourself
  89.      without reading the "Bumf". However, unless you are an
  90.      experienced data programmer, you should at least read this
  91.      section and the one on Relationships before embarking on any
  92.      serious project.
  93.      The crux of data management is "Data Integrity" or "Data
  94.      Verification".  You might know that "A Smith", "Smith's Garage"
  95.      and "Smith and Son" are all the same customer of yours but your
  96.      computer definitely does not! If you have a small business you
  97.      might wish to use Easy Base to create invoices - you might be
  98.      tempted to start by creating an invoice form in which you enter
  99.      your customers name, work done and price. - DON'T - Start
  100.      instead by creating a form to hold each of your customers'
  101.      names, addresses, credit limit etc.  If you sell things then
  102.      create a form to hold each of your stock items with their name,
  103.      partno, price etc.  These are your "Core" data forms from
  104.      which you "Lookup" data for other purposes. Each of your "Core"
  105.      data forms has a "Unique" field which defines the record as an
  106.      entity. "Smith's Garage" will always be "Smith's Garage" and
  107.      the lookup function described later will not allow any other
  108.      representation to be entered.
  109.      Although of less significance than "Data Integrity", the names
  110.      which you give to forms and fields are very important and worth
  111.      mentioning now. When you come to write "Lookup" derivations and
  112.      later, Procedural code you have to refer to your data by a
  113.      combination of its form and field names. Please give
  114.      considerable thought to the names you use. Each name should be
  115.      short but fully describe the form or field. The names of forms
  116.      should be plural and the names of fields singular. For example
  117.      - a form which is to hold details of your customers should be
  118.      called "Customers", the name field should be called "Name" and
  119.      the credit limit field should be called "Creditlimit" . When
  120.      you need to lookup data from this form the lookup function will
  121.      be written - Lookup(customers,name) and when you write
  122.      procedures the data will be referred to as customers.name ,
  123.      customers.creditlimit etc.  If you did not follow this naming
  124.      convention and called the form "F1" , the name field "customer"
  125.      and the credit limit field "Max cred" then writing procedure
  126.      code would be extremely frustrating.
  127.      It is equally important to give the same name to fields which
  128.      hold the same data in different forms. If you already had a
  129.      form called "Employees" which had fields "Worksno", "Name",
  130.      "Address" and "Taxcode" and you then created a "Payslips" form
  131.      the fields which hold the employee's name and taxcode should
  132.      also be called "Name" and "Taxcode". This not only makes it
  133.      easier to remember field names but when you come to write
  134.                                  - 2 -
  135. ................................................................................
  136.      procedure code, data can be transferred between one form and
  137.      another with the command "Copy all from". This command only
  138.      transfers data between fields with the same name. If you have
  139.      given different names to the fields in the two forms you will
  140.      have to transfer each individual field separately.
  141.      The fields which you create are of four general types - The
  142.      definition (unique) field, grouping fields, ordering fields and
  143.      descriptive fields.
  144.      When you create your "Core" data forms it will be fairly
  145.      obvious which is the definition field. In the "Employees" form
  146.      "Worksno" defines the record. In a "Manufacturers" form "Name"
  147.      defines the record. As a general rule, each form should have a
  148.      definition field. There is an exception to this where a form is
  149.      used to store temopary lists (described later) but for the
  150.      moment you should expect to have a definition or "Unique" field
  151.      on each form to prevent duplicate entries. When you create
  152.      secondary forms which lookup data from your "Core" forms the
  153.      data which defines the record as an entity will not necessarily
  154.      be contained solely in one of the fields you wish to display.
  155.      As an example - A magazine wholesaler has two "Core" forms, one
  156.      containing details of the magazines he supplies and one
  157.      containing customers details. He creates a form on which to
  158.      record orders from his customers. This "orders" form has three
  159.      fields, "Name"(for the customer), "Magazine" and "Quantity".
  160.      When a customer phones in an order for a particular magazine
  161.      the wholesaler will need to be warned if this particular
  162.      customer has already ordered this particular magazine but no
  163.      one field defines the record. In fact the record is defined as
  164.      unique by a combination of the two fields "Name" and "Magazine"
  165.      In this case, a fourth field should be added to the form in
  166.      which the two fields "Name" and "Magazine" are combined using
  167.      the "jointext" function. This field is then the "Unique" field
  168.      and no duplicate entries will be allowed.
  169.      In many secondary forms the records definition will be even
  170.      less obvious but if you are to create data storage for flexible
  171.      reporting you should always attempt to create a suitable
  172.      "unique" field.
  173.      For example :- An "Aircraft" form has a field "Manufacturer"
  174.      which is looked up from a "Manufacturers" form. It also has
  175.      fields for "Name" and "Mark". The definition of an aircraft is
  176.      what it is known as. If it has a name then it is known as a
  177.      combination of the manufacturer and the name (Supermarine
  178.      Spitfire) but if it does not have a name it is known as a
  179.      combination of the manufacturer and mark (English Electric P1b)
  180.      Even in these more complicated situations you can still create
  181.      a unique field to prevent duplicates. In the above example you
  182.      would create the unique field "Knownas" and derive it with the
  183.                                  - 3 -
  184. ................................................................................
  185.      formula - Jiontext(manufacturer,if(name = blank,mark,name))
  186.      When you define a field as unique Easy Base automatically
  187.      indexes this field.
  188.      The second type of field is a "Grouping" field. This is a field
  189.      which will be used in procedures to select subsets of records.
  190.      In the "Aircraft" form you might add a field "Type" which would
  191.      qualify each record as belonging to a group - "Fighter",
  192.      "Bomber", "Transport" etc. Grouping fields should also be
  193.      defined as indexed and should always be subject to data
  194.      integrity checking. Where the number of groups is small (17 or
  195.      less) Easy Base provides a quick method of data verification in
  196.      the "Choice" field type. If the number of groups is larger than
  197.      17 then you should create a "Core" form to hold the group names
  198.      and look them up into the secondary form.
  199.      The third type of field is used for ordering data. In many
  200.      instances the order in which you wish to print or view data
  201.      will be that of the definition field or one of the grouping
  202.      fields but not always. In the "Aircraft" form you might wish to
  203.      list them by the dates they were first introduced or by the
  204.      total production runs. In order to do this you would have to
  205.      add fields for "Date" and "Production". You would later write
  206.      procedures to list the aircraft with "Date in order" or
  207.      "production in order". Ordering fields should also be indexed
  208.      but they need not necessarily be checked for data integrity.
  209.      Fields which are not used for ordering or grouping are
  210.      descriptive and need not be indexed or integrity checked.
  211.      One of the most common mistakes made by beginners to data
  212.      management is to create different forms for the same data.
  213.      With the "Aircraft" form above you might be tempted to save all
  214.      the military aircraft of World War 1. Later you might create a
  215.      second form for the aircraft of World War 2. This would be a
  216.      mistake. The data you are recording is "Aircraft". The era to
  217.      which they belong should simply be another "Grouping" field.
  218.      If having saved your data you were asked for a list of all
  219.      "Boeing" military aircraft showing which wars they were used in
  220.      then this could be achieved with one simple procedure if they
  221.      were in one form but would be rather more difficult if they
  222.      were in two.
  223.      That example was fairly obvious but on many occasions it will
  224.      be easy to assume that two or more sets of data are separate
  225.      when in fact they are simply groups of the same.
  226.      Should you decide to write your own accounting program (Which
  227.      is not as daunting a task as it might seem on the surface) You
  228.      might be tempted to create forms for a Sales Ledger, Nominal
  229.      Ledger and Customers Accounts. In fact the entries in the
  230.                                  - 4 -
  231. ................................................................................
  232.      Nominal Ledger and Customers Accounts are simply sub groups of
  233.      the entries in the Sales Ledger. Provided that you include
  234.      grouping fields for the customers account number and nominal
  235.      account name you can construct customers and nominal accounts
  236.      when required by extracting and totalling the sub sets. There
  237.      is no need to save them as separate data.
  238.      The final problem you will encounter when deciding how to store
  239.      data is that of "Related Lists".  Consider the "Aircraft" form.
  240.      If you had a grouping for "Airliner" you might wish to record
  241.      all the airlines which operate each aircraft. You cannot just
  242.      add fields to the "Aircraft" form - One airliner might only be
  243.      operated by one airline and another might be operated by fifty.
  244.      To store this data you need another form let's call it Userlist
  245.      with fields "Aircraft" , "Airline" and "Uni" which is the
  246.      unique field derived by joining the other two. The "Aircraft"
  247.      field is looked up from the "Aircraft" forms unique field
  248.      "Knownas" and the "Airline" field is looked up from the
  249.      "Airlines" form "Name" field which is also unique.
  250.      In this form you enter one record for each combination of
  251.      aircraft and airline. When you come to report on your data you
  252.      can list single records from the main "Aircraft" form together
  253.      with all related records from the "Userlist" form.
  254.      ...................PROCEDURE CODE.............
  255.      declare output fields
  256.         aircraft.knownas : Aircraft.production :aircraft.seats
  257.         userlist.airline
  258.      end
  259.      for aircraft with knownas = input.knownas
  260.         print formfields
  261.         for userlist with aircraft = aircraft.knownas
  262.            print userfields
  263.         next
  264.      next
  265.      ...................FORMAT.....................
  266.      .formfields
  267.                        { Aircraft.knownas field }
  268.            Production { Prodn. field}    Seats  {Seats field }
  269.                              Operated by :-
  270.      .userfields
  271.                       { Userlist.Airline field  }
  272.      .end
  273.                                  - 5 -
  274. ................................................................................
  275.                              FORM DESIGN
  276.      To start designing your forms select "Form Design" then "Design
  277.      new Form" from the menu system.  You are presented with a blank
  278.      form. Each form has four pages. To move from one page to the
  279.      next use the PgDn and PgUp keys. To move the cursor around on a
  280.      page use the arrow keys. Designing your form is a bit like
  281.      designing a form on paper. If you were to type on a paper form-
  282.               Name     .................
  283.               Address  .................
  284.                        .................
  285.                        .................
  286.                        .................
  287.      Then in Easy Base you type Name and Address as above but
  288.      instead of typing the dots you define fields for the data to be
  289.      entered to.
  290.      Easy Base provides several facilities for "Polishing" the
  291.      presentation of your forms and these are covered first before
  292.      moving on to field definition.
  293.      If you wish to enclose your text within boxes or in some
  294.      tabular format Press F3 and select "Line Drawing".  To draw
  295.      lines on the screen hold down the Alt key, The Ctrl key or both
  296.      and drive the cursor around with the arrow keys. The Alt key
  297.      draws double thin lines, the Ctrl key draws single thin lines
  298.      and a combination of both draws a thick single line. Press Esc
  299.      when you are finished line drawing to return to normal editing.
  300.      If you wish to shade areas of the screen then again press F3
  301.      and select "Shading". Shading works much the same as Line
  302.      Drawing.
  303.      If you require Greek, Mathematical or International characters
  304.      which cannot be typed directly from the keyboard then press F3
  305.      and select either "Greek and Mathematical" or "International" A
  306.      menu of all such characters provided by your PC will appear.
  307.      The one you select is printed to your form at the cursor
  308.      position.
  309.      If you wish to use other than the default text colour then
  310.      press F4 after you have typed your text. In each Easy Base
  311.      screen colour set you can select one of two alternate text
  312.      colours or "Blink" - choose 1, 2 or 3 .  To change the colour
  313.      of your text or lines just hold down the shift key and drive
  314.      the cursor over the text you want to change with the arrow
  315.      keys. Press Esc when you have finished colouring your form.
  316.      Text input in the form designer has "overtype" as the default.
  317.      If you wish to move text (or fields) to the right press the
  318.                                  - 6 -
  319. ................................................................................
  320.      Ins key. Insert mode is indicated by a block cursor and
  321.      Overtype by an underscore cursor. (This is the opposite to all
  322.      other editors in Easy Base as it keeps the underscore cursor as
  323.      the default)
  324.      To insert a blank line above text or fields press F1. You
  325.      cannot scroll text or fields between pages in form design.
  326.      If you need to move areas of your form then press F9, shade the
  327.      rectangle you wish to move and move it around with the arrow
  328.      keys. You can also transport the rectangle between pages with
  329.      the PgUp and PgDn keys.  F9 can also be used to erase areas of
  330.      the screen.
  331.      When you are ready to define the data fields, position the
  332.      cursor where you want the field to start and press F10.
  333.      A window opens into which you enter all the attributes for the
  334.      field.
  335.      The first attribute is "Field Name". If you have typed text to
  336.      the left of the field then Easy Base will have inserted this as
  337.      a default in the Field Name attribute. If it's not the name you
  338.      want just edit it. When you are happy with the field name press
  339.      return or the down arrow to the "Data Type" attribute. A menu
  340.      appears with the nine different field types. (The field types
  341.      are described fully in the Programmers Reference)
  342.      When you have chosen a field type the cursor automatically
  343.      moves down to the "Field Length" attribute if you have chosen
  344.      "Text", "Integer", "Fixed Point" or "Floating Point" and to the
  345.      "Mandatory Entry" attribute if you have chosen one of the
  346.      others. Enter the field length you require in characters. If
  347.      you have chosen "Fixed Point" as the field type there are two
  348.      entries, one for the digits left of the decimal point and one
  349.      for the digits right of it. If your field is to hold a currency
  350.      value then the second entry will of course be 2.
  351.      You must supply values for the first three field attributes.
  352.      The others all have preset defaults so you can save your field
  353.      at this point if none of the others have to be changed.
  354.      The next Field Attribute is "Mandatory Entry" which has a
  355.      default of "No".  You can set this to "Yes", "No" or "If". If
  356.      you set it to "Yes" then Easy Base will not allow a record to
  357.      be filed with this field left blank.  If you set it to "If"
  358.      then the "Code Snippet" editor opens up and you can enter the
  359.      condition under which an entry becomes mandatory. If you were
  360.      designing a "Payments" form and one of the fields "Paymethod"
  361.      could be filled with either "Cash" or "Cheque". Then the field
  362.      "ChequeNo" would have to be filled only if the "Paymethod"
  363.      field had "Cheque" entered in it.  To make an entry mandatory
  364.                                  - 7 -
  365. ................................................................................
  366.      in the "Chequeno" field only if "Paymethod" is "Cheque" enter -
  367.      paymethod = "cheque" in the Code Snippet editor.
  368.      When you use the Code Snippet editor for Mandatory Entry and
  369.      for User Entry, only the condition is entered :-
  370.            total < 100
  371.            name = blank
  372.            length = blank or breadth = blank
  373.      the "if" is assumed.
  374.      If you set the "Mandatory Entry" attribute to either "Yes" or
  375.      "If", a window will open into which you can type the message
  376.      which you wish to be displayed should an attempt be made to
  377.      file a blank entry.  If you leave the message blank Easy Base
  378.      will supply the default message "This field must be filled !".
  379.      The next attribute is "Unique". This can be set to "Yes" or
  380.      "no".  You can only have one unique field on a form. If you
  381.      have already defined a field as the unique field and you change
  382.      your mind and define another then Easy Base will automatically
  383.      cancel the unique attribute on the first field.  Indexing is
  384.      automatically set to "Yes" for the unique field.
  385.      The next attribute is "Indexed". Select "Yes" or "No"
  386.      When you set "Index" to "yes",  Easy Base Creates a separate
  387.      "Index" file in which the contents of the field are kept in up
  388.      to date order. Index files are used by Easy Base in exactly the
  389.      same way that you would use an index in a book to find things
  390.      quickly.
  391.      The next attribute is "User entry".  This has a default of
  392.      "Yes" but can be set to "No" or "If".  If you set this
  393.      attribute to "No" then the cursor will not visit the field
  394.      during record entry so the user cannot alter its contents. You
  395.      would normally set this to "No" if the contents are derived or
  396.      calculated from the values of other fields. You can set this
  397.      attribute to "If" if the value entered in another field makes
  398.      this one superfluous. For example, in the "Aircraft" form, if
  399.      you had a field "Passengers" and the type had been entered as
  400.      "Fighter" there would be no point in the cursor moving to the
  401.      "Passengers" field.  When the Code Snippet editor opens you
  402.      could type:-
  403.            type = "Transport" or type = "Airliner"
  404.      The next field attribute is "Display".   When the cursor
  405.      reaches this attribute a menu appears with the seven different
  406.      ways in which the field can be displayed.
  407.                                  - 8 -
  408. ................................................................................
  409.      The field display attribute settings have the following
  410.      meaning.
  411.      1.  FIELD
  412.          The field's size is displayed as a block which shows
  413.          up against the screen background.
  414.      2.  TEXT
  415.          The field size does not show up against the screen
  416.          background and the contents are in the default text colour.
  417.      3.  1ST ALT COL.
  418.          As Text but with the contents in the first alternate colour
  419.      4.  2ND ALT COL
  420.          As Text but with contents in the second alternate colour.
  421.      5.  BLINKING
  422.          As Text but the contents blink.
  423.      6.  INVISIBLE
  424.          Neither the size nor the contents can be seen.
  425.          Invisible fields are used to hold compound index fields and
  426.          the results of intermediate calculations which the user
  427.          need not see.
  428.      7.  CODEWORD FIELD
  429.          The size of a codeword field shows against the screen
  430.          background but its contents are masked by stars.
  431.          Codeword fields are used to collect passwords for
  432.          restricted menus or procedures. An onlooker cannot see the
  433.          password which is being entered.
  434.      The final field attribute is "Derived". If you set this to
  435.      "yes" then the Code Snippet editor opens and you can enter the
  436.      formula by which the fields contents are to be derived.
  437.      In the Code Snippet editor you can enter almost any derivation
  438.      formula. Formulae consist of field names operators and
  439.      functions.
  440.         price * markup
  441.         VATon(net,vatrate)
  442.         datetext(system date)
  443.         if(sex = male,"Mr","Ms")
  444.                                  - 9 -
  445. ................................................................................
  446.      All the operators and functions are fully described with
  447.      examples of how they are used in the Programmers Reference.
  448.      If in the Code Snippet editor you cannot remember a field or
  449.      function name then Press F1 for the reminder lists.
  450.      There is a cut and paste facility in the Code Snippet editor.
  451.      To mark text hold down the shift key and move the cursor with
  452.      the arrow keys. When you release the keys the "Cut" or "Copy"
  453.      choice will appear. To paste text, position the cursor at the
  454.      insertion point and press Shift + Ins.  Text which is cut or
  455.      copied from the derivation of one field can be pasted into the
  456.      derivation of any other field in any other form.
  457.      When you have finished entering the field attributes press F2
  458.      to save the field. When you have defined all the fields press
  459.      F2 to save the form.
  460.      There is one other facility in the Form Design editor.  If you
  461.      press F5 at any time you enter "Derivation Test Mode".  In
  462.      derivation test mode you can enter data to your fields and
  463.      check if your derivations work correctly.  Any fields which you
  464.      have defined as invisible are not hidden in test mode.  The
  465.      main advantage of test mode as opposed to testing in Record
  466.      Entry comes not when you are designing new forms but when you
  467.      wish to modify one after you have saved many records in it.  If
  468.      you add, delete or alter the length of a field then the entire
  469.      data file has to be reformatted and this takes time.  With
  470.      "Derivation Test Mode" you can ensure that the modifications
  471.      you have made are correct before reformatting.
  472.      The only exception to test mode is if you have added a new
  473.      lookup function and you have not yet entered the relationship.
  474.      If you select test mode with a relationship missing you will
  475.      get an error message and be returned to Form Design.
  476.      When you save your form Easy Base tests it in derivation test
  477.      mode before saving. If it cannot find a relationship you will
  478.      be given an error message and offered the choice to remain in
  479.      Form Design (which you would do should you know that the
  480.      relationship exists and you must therefore have mistyped a
  481.      lookup formula) or to save and go to the relationships form
  482.      Which you would do if the relationship had not yet been
  483.      entered)
  484.      If you opt to go to Relationships Easy Base will transfer you
  485.      to the relationships form and back again via a macro.
  486.                                  - 10 -
  487. ................................................................................
  488.                  RELATIONSHIPS AND THE LOOKUP FUNCTION
  489.      In Easy Base the Lookup Function together with pre-recorded
  490.      relationship links provide two of the most important facilities
  491.      of a data management system.
  492.          1. Reuse of previously entered data.
  493.          2. Verification of text data.
  494.      Consider the situation where you have designed a form to hold
  495.      information about your business's customers. The form has an
  496.      "accountno" field which has been derived as "Sequence" and this
  497.      is therefore the "Unique" field on the form.  It also has
  498.      fields "Name" and "Address".  All your customers have now been
  499.      recorded in this form.  You now want to create an invoice form.
  500.      Each invoice issued will have to have a customer's name and
  501.      address entered on it.  All the names and addresses are already
  502.      filed in Easy Base so they do not have to by typed again.
  503.      Provided that Easy Base knows which customer's name and
  504.      address is required it can copy it automatically from the
  505.      "Customers" form to the "Invoice" form.
  506.      The way in which Easy Base accomplishes this is exactly the
  507.      same as you would accomplish the task manually in a hand
  508.      written system. If you knew where to find the book in which
  509.      your customers names had been written and you knew the
  510.      customers account number then you could find the customers name
  511.      and address.
  512.      The only slight difference for the computer is that while you
  513.      would consider it "Obvious" that the account number on the
  514.      invoice would be the same as the account number in the
  515.      addresses book your computer does not - You have to tell it.
  516.      To tell Easy Base where to look and that the "accountno" is the
  517.      link, you enter a record in the "Relationships" form.
  518.      When you select "Relationships" from the main menu you will see
  519.      five fields to be filled.  The first field is the name of the
  520.      form which data is to be copied to. In this case you will enter
  521.      "Invoices".  You will notice that easy base has displayed a
  522.      list of all your form names and that you must choose one.  You
  523.      cannot enter the name freehand.  This "internal" data
  524.      verification is the same as you will be doing for your own data
  525.      later.
  526.      The second field is for the name of the form in which the data
  527.      can be found.  In this case select "Customers".
  528.      The next two fields record which fields in the primary and
  529.      secondary form hold the "Linking" data. In this case select
  530.      "acountno" in both.
  531.                                  - 11 -
  532. ................................................................................
  533.      The final field is the name of the relationship record.  You
  534.      will notice that Easy Base has already entered a default name
  535.      of "Customers".  The relationship name can be anything you like
  536.      but as the "Lookup" function which you are about to use quotes
  537.      the relationship name as its first parameter and the field to
  538.      be copied as its second then Lookup(customers,name) has to be
  539.      more meaningful and easy to remember than any other name you
  540.      could give.
  541.      When you have entered all the fields press F2 to save the
  542.      relationship, return to Form Design and load your "Invoice"
  543.      form.
  544.      All that remains to do now is edit the field attributes of the
  545.      "Name" and "address" fields.  To edit a field you can either
  546.      press F10 with the cursor on the form background and select the
  547.      field to edit by name, or you can position the cursor within
  548.      the field you wish to edit and then press F10, in which case
  549.      the field attribute window will open automatically.  Position
  550.      the cursor in the "Name" field and press F10. Move the cursor
  551.      to the "Derivation" attribute and set it to yes. (you can move
  552.      the cursor from the "Name" attribute directly to the "Derived
  553.      attribute by pressing the up arrow)
  554.      When the Code Snippet window opens type -
  555.           Lookup(customers,name)
  556.      and press F2.  If you had not already done so then set the
  557.      "User Entry" attribute to "No".
  558.      Press F2 to save the new field attributes and then do the same
  559.      for the "Address" field, this time entering the derivation -
  560.          Lookup(customers,address)
  561.      To test that you have typed the lookups correctly press F5 for
  562.      Derivation Test Mode. Enter a customers account number in the
  563.      "Acountno" field and press the return key. If your formulae are
  564.      correct the customers name and address will appear in the
  565.      "Name" and "Address" fields.
  566.      In this example you have performed two "Secondary" lookups.
  567.      Both the "Name" and "Address" fields were found using the
  568.      "accountno" link which you had to enter correctly in order
  569.      to find the other two fields.
  570.      The real power of the Lookup function is only realized when you
  571.      perform "Primary" and "Secondary" lookups.  In a "Primary"
  572.      lookup the field whose value is to be looked up is also the
  573.      "Link".  It is "Primary" lookups which are used for data
  574.      integrity checking.
  575.                                  - 12 -
  576. ................................................................................
  577.      Consider the "Aircraft" and "Manufacturers" forms which were
  578.      discussed earlier.  Suppose that you want to lookup the
  579.      manufactures name and the name of his base airfield into the
  580.      "Aircraft" form.  The definition field in the "Manufacturers"
  581.      form is "Name" - There is no handy "accountno".  You are going
  582.      to have to enter a relationship between "Aircraft" and
  583.      "Manufacturers" linking the two fields "Manufacturer" in the
  584.      "Aircraft" form with "Name" in the "Manufacturers" form.
  585.      Having done this you could derive the "Base" field in the
  586.      "Aircraft" form with - Lookup(manufacturers,base) - and it
  587.      would be looked up when you entered the manufacturers Name just
  588.      as in the invoice example.  But what of the "Manufacturers"
  589.      field itself.  Was the name you entered in the manufacturers
  590.      form "A.V.Roe", "A.V.Roe & Co." or "AVRO A/C Co.".
  591.      Easy Base provides a simple solution to this problem.
  592.      Having entered the relationship, return to Form design and
  593.      enter the lookup derivations. Derive the "Base" field with -
  594.          Lookup(manufacturers,base)
  595.      and the "Manufacturers" field with
  596.          Lookup(manufacturers,name)
  597.      This time, leave the "User Entry" attribute set to "Yes" in the
  598.      "Manufacturers" field.
  599.      Press F5 for "Test mode".  When the cursor enters the
  600.      "Manufacturers" field type -  AV*  - and press return.
  601.      Provided there is only one manufacturer whose name begins with
  602.      "AV" the Avro name will be looked up into the "Manufacturers"
  603.      field and its representation will always be exactly the same as
  604.      the original entry in the "Manufacturers" form.  If there are
  605.      several manufacturers whose names begin with "AV" then a menu
  606.      will appear listing all of them and you can choose the one you
  607.      want. As soon as you select the name the secondary lookup
  608.      "Base" will fill automatically.
  609.      If you cannot remember the first letters of the name you want
  610.      to look up - say for example that you could only remember that
  611.      "Roe" was in the name - then type Roe* and press return.  If
  612.      any manufacturers names begin with "Roe" they will be displayed
  613.      first. If not Easy Base will fill the "Manufacturer" field with
  614.      the first name it finds with the letters roe in it.  If this is
  615.      not the one you want press F3.  Each time you press F3 Easy
  616.      Base will find the next name containing the letters until you
  617.      find the one you want.   As a final resort - if you really
  618.      can't remember what you are looking for - just enter an "*" on
  619.                                  - 13 -
  620. ................................................................................
  621.      its own and press return. Easy Base will then list all the
  622.      manufacturers names for you to choose from.
  623.      There is no limit to the number of secondary lookups which can
  624.      be made from each primary and there is no limit to the number
  625.      of different forms you can look data up from.
  626.      If you have many different forms which all look up data from
  627.      the "Customers" form then they can all use the same
  628.      relationship name "Customers" but if you have more than one
  629.      relationship between the same two forms then they must have
  630.      different names.
  631.      If you had a "Stock" form with the unique field "Item" and
  632.      another field "Price" then you could add four fields to your
  633.      "Invoice" form - "Item", "Quantity" "Price" and "Total".
  634.      You would enter a relationship "Stock" between "Invoice" and
  635.      "Stock" with the related fields being "Item" in both forms.
  636.      In your invoice form you would derive :-
  637.         Item as    Lookup(stock,item)
  638.         Price as   Lookup(stock,price)
  639.         Total as   quantity * price
  640.      When you entered the "Item" field (primary lookup) the price
  641.      field would fill automatically and when you entered the
  642.      "Quantity" the "Total" field would be calculated.
  643.      However, if you now add four more fields "Item2", "Price2",
  644.      "Quantity2" and "Total2" you will need another relationship
  645.      between "Invoice" and "Stock" this time linking "Item2" in the
  646.      "Invoice file" with "Item" in the stock file and you cannot now
  647.      use the default name "Stock" for the relationship.
  648.      Although you can give your additional relationship any name you
  649.      like, the best name will be "Stock2".
  650.      Please note that this example is used purely to show the use of
  651.      multiple relationships between the same two forms.  If you are
  652.      intending to write an invoicing system then unless you know
  653.      that there will only be a limited number of items on each
  654.      invoice this is not a practical way to tackle the problem.
  655.      In a flexible invoicing system each item and quantity is
  656.      entered via a procedure to a temporary list form whose contents
  657.      are then printed to the invoice.
  658.      From V9 the lookup function also accepts a third parameter with
  659.      which you can specify the display of a field other than that
  660.      which is being looked up. See "Lookup" in Programmers Reference
  661.                                  - 14 -
  662. ................................................................................
  663.                                DATA ENTRY
  664.      As soon as you have designed forms you can enter and view data
  665.      directly using the default screen you created.  To enter data
  666.      to a form select "Data Entry" from the main menu and choose the
  667.      form you wish to use.
  668.      Your default entry screen will appear with the cursor in the
  669.      top left field. The top line of the screen shows the name and
  670.      page number of the form you are using together with the system
  671.      date and time. Line 2 shows the number of the record you are
  672.      creating or editing on the left hand side. It is also the line
  673.      on which any error messages are passed. The bottom line lists
  674.      the most used function keys and is also the line on which help
  675.      prompts are displayed.
  676.      To move the cursor around between fields you can use all of the
  677.      cursor control keys which work as follows:-
  678.      The Return key moves from field to field in the order top left
  679.      to bottom right unless you have overridden this in form design
  680.      by deriving fields with "Goto (fieldname) Next".
  681.      The Tab key moves the cursor from field to field in the order
  682.      bottom right to top left (reverse of Return).
  683.      The arrow keys move the cursor in the direction indicated.
  684.      The Home Key moves the cursor to the beginning of the current
  685.      field if it is not already there and to the first field on the
  686.      page if it is.
  687.      The End Key moves the cursor to the end of text if it is in a
  688.      text field and to the last field on the page if it is not.
  689.      The PgUp and PgDn Keys move between pages if your form has more
  690.      than one.
  691.      When you have entered the data for your first record press F2
  692.      to save it to disk. The screen will clear, the message "Record
  693.      1 has been added" will appear briefly on line two and you will
  694.      be ready to enter the next record.
  695.      If some of your fields are primary lookups then you use them
  696.      exactly the same as was described for "Derivation Test Mode" by
  697.      entering part of the text followed by a star and pressing the
  698.      Return Key.
  699.      Once you have saved a few records to disk you may wish to view
  700.      or edit them. You can bring previously entered records back to
  701.      the screen for editing in several ways.  From record creation
  702.      the F5 Key brings up the first record and subsequent presses
  703.                                  - 15 -
  704. ................................................................................
  705.      bring up the next record. Similarly, from record creation the
  706.      F4 Key brings up the last record and subsequent presses bring
  707.      up the previous record.
  708.      Once you have entered several records this process becomes
  709.      impracticable and you "search" for the record you wish to view
  710.      or edit.  Position the cursor in any field and type part of the
  711.      field contents you wish to search for followed by a star and
  712.      press F3.
  713.      Searching for records within a form is a similar process to
  714.      looking up data except that you press the F3 rather than the
  715.      Return Key to initiate the process. If the field in which you
  716.      are searching is indexed and more than one record matches the
  717.      data you have entered then Easy Base will make a list of all
  718.      the field contents which match for you to choose from.  If the
  719.      field is not indexed then Easy Base will bring up the first
  720.      record it finds a match in. If this is not the record you want
  721.      then press F3 again. Easy Base will find another match on each
  722.      successive press of the F3 key until you find the record you
  723.      want. As with lookups, Easy Base will search for "Part Matches"
  724.      after it has exhausted all the records where the entered data
  725.      matches the beginning of the field and if you enter a star on
  726.      its own and press F3, Easy Base will list all the field
  727.      contents for you to choose from.
  728.      When you have brought a previously entered record back to the
  729.      screen you will notice that line 2 now displays "Editing Record
  730.      x of y " rather than "Creating New Record x ".  Easy Base
  731.      automatically changes from "Create" to "Edit" mode when you
  732.      view a record.  The changes which you make on screen are not
  733.      entered to the record on disk until you press F2.
  734.      To clear the contents of the field in which the cursor lies
  735.      rather than delete each character press F6. To return to
  736.      "Create" mode press F6 twice.
  737.      Not all of the active function keys are listed on the prompt
  738.      line. To see a full menu of the function key uses press F1 for
  739.      the Function Key Menu.  The following is a summary of the
  740.      function key usage in Data Entry:-
  741.      F1
  742.      The F1 Key brings up the function key Menu.
  743.      F2
  744.      The F2 Key writes a new record from "Create" and updates the
  745.      record on screen from "Edit" mode.
  746.                                  - 16 -
  747. ................................................................................
  748.      F3
  749.      The F3 key initiates searches for previously entered records
  750.      based on the data entered in the current field.
  751.      F4
  752.      The F4 key moves to the previous record when in "Edit" mode and
  753.      to the last record from "Create" mode.
  754.      F5
  755.      The F5 Key Moves to the next record when in "Edit" mode and to
  756.      the first record from "Create" mode.
  757.      F6
  758.      The F6 key clears the current field on the first press and
  759.      returns you to "Create" mode on the second press.
  760.      F7
  761.      The F7 key deletes the record currently on screen in "Edit"
  762.      mode.  When you delete a record with the F7 key it is not
  763.      actually erased from the disk. It is simply "Flagged" for
  764.      deletion at the next "Pack" operation. If you delete a record
  765.      accidentally you can reinstate it any time before the form is
  766.      next packed.
  767.      F8
  768.      The F8 key creates a new record by copying the record currently
  769.      on screen. If a new record you wish to create contains similar
  770.      data to one already entered then you can find the previous
  771.      entry, change the unique field and copy it with F8 rather than
  772.      type it all again.
  773.      F9
  774.      If you know the number of the record you wish to view or edit
  775.      you can press F9 and enter the record number. Easy Base will
  776.      then bring the record whose number you have entered to the
  777.      screen.
  778.      F10
  779.      When you press the F10 key Easy Base searches for records which
  780.      are "Flagged" for deletion.  When it finds one it will bring it
  781.      to the screen. You can reinstate a deleted record by pressing
  782.      F2 while it is on screen. The F5 key searches for the next
  783.      deleted record and the Escape key returns you to "Live
  784.      Records".
  785.                                  - 17 -
  786. ................................................................................
  787.      F11
  788.      F11 prints the record on screen exactly as formated for the
  789.      screen at 10 CPI. Some printers cannot print 80 characters at
  790.      10 CPI so avoid using the last three screen columns.
  791.      F12
  792.      The F12 key brings up the form's "Options". There are four
  793.      options in Data Entry.
  794.         1. Clear screen on Adding Record.             (Default Yes)
  795.         2. Confirmation Required to delete Records.   (Default Yes)
  796.         3. Confirmation Required to abandon Edits     (Default No)
  797.         4. Clear Field on Editing                     (Default No)
  798.      If you change "Clear Screen on adding Record" to "No" then,
  799.      when you press F2 to file a new record, the data which is
  800.      written to disk remains on screen ready for the next new
  801.      record. This is useful if you are entering several records and
  802.      many of the fields in each record contain the same data. You
  803.      only have to overwrite the fields which are different each
  804.      time.
  805.      If you have many records to delete then set option 2 to "No"
  806.      and you will be able to delete them without having to confirm
  807.      each one.
  808.      If you set option 3 to "Yes" then Easy Base will ask you to
  809.      confirm that you wish to leave a record which you have edited
  810.      but not updated to disk.
  811.      If you set option 4 to "Yes" then Easy Base will clear the
  812.      old contents of any field you start to edit.  This is most
  813.      useful when used in conjunction with option 1. You can file a
  814.      record, retain the contents for the next record and when you
  815.      edit the fields which are different you do not have to first
  816.      delete the data in them.
  817.      The options you set for any given form remain with it until
  818.      changed. They do not revert to the defaults when your computer
  819.      is turned off and each form can have different option settings.
  820.      Ctrl + E
  821.      If you press the "E" key while holding down the Ctrl key you
  822.      will get the extended "Greek" and "International" characters
  823.      menu which was discussed in form design.
  824.                                  - 18 -
  825. ................................................................................
  826.      Ctrl + S
  827.      If you press The "S" key while holding down the Ctrl key you
  828.      start the Spell-checker.  The Spell-checker will check the
  829.      current field. If it finds a word not included in the Easy base
  830.      dictionary it will offer you the choices to leave the word and
  831.      continue, add the word to the dictionary, or choose one of the
  832.      suggestions for replacement.
  833.      The Spell checker does not automatically move from field to
  834.      field but once you have started it, it remains active and will
  835.      immediately check the next text field you move the cursor to.
  836.      The Spell-checker is cancelled if you press the Escape key or
  837.      if you press the F2 key to update the record.
  838.      PRINTING RECORDS
  839.      For more control over a printed record than you have with F11,
  840.      see the For..Next command in the Programmers Reference.
  841.      (Selected in Browse qualification.)
  842.                                  - 19 -
  843. ................................................................................
  844.                         PROCEDURES (REPORTING)
  845.      The Easy Base procedure generator is the means by which you
  846.      manipulate and report on your data.
  847.      Each procedure has at least one part, the procedure code.  The
  848.      procedure code contains the instructions you write to tell Easy
  849.      Base what you want done.
  850.      If your procedure has an "output", in other words your
  851.      instructions tell Easy Base to send data to the screen or to
  852.      the printer, then the procedure must also have an Output
  853.      Format. The Output Format is where you show Easy Base how you
  854.      want the data you are about to "output" arranged on the screen
  855.      or page.
  856.      If what your procedure is to do depends on variables, ie it
  857.      requires information from the operator or from Looked up data
  858.      from one or more of your forms then it also requires an "Input
  859.      Screen".  The Input Screen is where you gather the variable
  860.      information that your procedure needs in order to carry out its
  861.      task.
  862.      Select "procedures" from the main menu and have a look at the
  863.      items on the procedures menu.
  864.      You will notice that the menu has pre-selected item 2 "Load
  865.      Existing Procedure". Other than your first procedure this is
  866.      the most useful starting point.  Item 1, "Create New Procedure"
  867.      is only required if you wish to start a new procedure after you
  868.      have another one loaded. The three parts to a procedure
  869.      mentioned above are created and edited at items 3,4 and 5.
  870.      Procedures, like forms, are saved to disk and can be re-used
  871.      repeatedly. Item 6 runs the current procedure and item 7 saves
  872.      it to disk.
  873.      Item 8 deletes procedures which are no longer required and Item
  874.      9 copies an existing procedure. Often you will require a
  875.      procedure which is similar to one you have already created. It
  876.      is much quicker to copy the first procedure and then edit it
  877.      than to start a new procedure from scratch.
  878.      Item 10 recalls the last output from a procedure to the screen.
  879.      If you need to see the output from a procedure but it is not
  880.      imperative that you have the most up to date information,
  881.      (close of business / month end figures Etc) then it is much
  882.      quicker to view the last output than to re-run the procedure.
  883.      Finally, a small window just below the menu shows the name of
  884.      the currently loaded procedure. In this case it is "Untitled".
  885.                                  - 20 -
  886. ................................................................................
  887.      If you have not already done so, read the descriptions of the
  888.      Declare, For..Next, If..Then, Print and Printer Control
  889.      commands in the Programmers Reference now. These are the basis
  890.      of all "reporting" procedures and should be thoroughly
  891.      understood. If you are a programming beginner then some of the
  892.      examples in the For..Next section may seem a bit advanced -
  893.      Just ignore them - for the moment it is only important that you
  894.      understand the principle of the loop and the qualifications
  895.      that can be applied to it.
  896.      Now select item 4 to write your first Procedure Code.
  897.      The next few pages will describe simple reporting procedures
  898.      based on the "Aircraft" form. To write like procedures for the
  899.      forms you have designed all you have to do is substitute your
  900.      form and field names.
  901.      Before you start, have a look at the function key list on the
  902.      bottom line. F2 saves your code and checks it. If you press the
  903.      Escape key your code is still saved but the checking routine is
  904.      bypassed. If you have written code and find that it is not
  905.      passed on F2 because, for example, one of your form fields
  906.      needs to be indexed, then you can still save the code you have
  907.      written while you modify the form.
  908.      F3 and F4 provide search and replace facilities similar to a
  909.      word processor.
  910.      There is a cut and paste system.  To mark code for cutting or
  911.      copying hold down the Shift key and shade the code with the
  912.      arrow keys.  As soon as you release the keys a menu will pop up
  913.      with three options - Cut, Copy or Indent. The cut and copy
  914.      options work exactly the same as in the Code Snippet editor
  915.      with Shift + Ins used to paste the text. If you select "Indent"
  916.      then you can indent all the selected lines at once with the
  917.      left and right arrow keys.
  918.      If you want to print out your code then press F10.
  919.      The F1 key, labelled "Help" is the key you use when you can't
  920.      remember something.  It has all the names of your forms, the
  921.      names of the fields in each form and the names of all Commands,
  922.      functions, and System values.  If Easy Base recognizes the
  923.      context of your procedure when you press F1 then it will list
  924.      the names you need (Formnames, fieldnames or Commands). If not
  925.      a menu will appear from which you can pick which you need.
  926.      With the cursor at the start of the top line on your blank
  927.      procedure screen press F1.
  928.      The "Commands" reminder list appears on the right hand side of
  929.      the screen.  The command you want is the first one , "Declare
  930.      Output Fields" but before selecting it have a look at how to
  931.                                  - 21 -
  932. ................................................................................
  933.      select from the reminder lists. There are over fifty commands
  934.      on this list but only the first seventeen are shown. You can
  935.      scroll though them with the arrow keys but you can also use the
  936.      inbuilt alphabetic search facility. If you type "o" then the
  937.      highlight bar will move directly to the "Odd Page Print"
  938.      command.
  939.      Take the highlight bar back to the "Declare Output Fields"
  940.      command either by scrolling or by pressing the Home key and
  941.      press return.  The command will be inserted on the first line,
  942.      the cursor will move to the second line and the "Forms"
  943.      reminder list will appear.  Select the form which you wish to
  944.      report on. In my example case this will be "Aircraft".
  945.      "Aircraft." is inserted on the second line and the "fields"
  946.      reminder list appears. I select "Knownas".  I also wish to list
  947.      the aircraft's mark and type so I write.
  948.      Declare output fields
  949.         Aircraft.knownas : Aircraft.mark : Aircraft.type
  950.      end
  951.      Declare the fields you wish to list either by typing them
  952.      freehand or by pressing F1 for reminders.
  953.      Now complete your procedure code:-
  954.      Declare Output fields
  955.         Aircraft.knownas : Aircraft.mark : Aircraft.type
  956.      end
  957.      for Aircraft
  958.         Print list items
  959.      next
  960.      and press F2 to check and save the code.
  961.      If you have typed everything correctly you will be returned to
  962.      the Procedures menu.  If you have misspelled something then the
  963.      line with the error will be highlighted and you will get an
  964.      error message. Correct the error and press F2 again.
  965.      Easy Base now knows that it is to list the three fields
  966.      Knownas, Mark and Type from all the records in the "Aircraft"
  967.      form.  It does not know how they are to be arranged or whether
  968.      they are to be printed or just shown on screen. This
  969.      information must now be recorded on the procedures "Output
  970.      Format".
  971.      Select item 5, "Output Format", from the procedures menu and
  972.      have a look at the screen. As usual the bottom line shows the
  973.      function key usage. To insert a blank line you use F1 as in
  974.      form design. F2 saves the format and the Escape Key abandons
  975.      it. F3 gives you a line drawing facility similar to that in
  976.                                  - 22 -
  977. ................................................................................
  978.      form design and Ctrl + "E" brings up the Greek and
  979.      International characters menu.  The F10 Key is used to place
  980.      your output fields.
  981.      The upper status line shows the paper size you have selected at
  982.      the left hand edge. If you scroll to the right it also shows
  983.      where the right hand edge of your paper will be at the three
  984.      different print sizes 10, 12, and 17 characters per inch.
  985.      On the right hand side of the screen a small menu will have
  986.      appeared offering you a choice of Format Section names. You do
  987.      not have to use one of these they are just to save you time.
  988.      For the moment select "List Items" from this menu.
  989.      .List items  will appear on the first line and the cursor will
  990.      move to the second.  For a first procedure we will simply list
  991.      the fields required in columns. To do this move the cursor in
  992.      along the second line to leave a reasonable margin and press
  993.      F10 to place the first field.  A menu appears listing the three
  994.      fields which were declared in the procedure's code. I select
  995.      "Aircraft.knownas".  As soon as The field has been selected a
  996.      window opens showing the default type and length of the field.
  997.      You can change these defaults if you wish the printed length or
  998.      type(for numeric fields) to be different in the report to what
  999.      it is in the form. This window also presents an extra attribute
  1000.      marked "Trim Trailing Spaces" which defaults to "No". If you
  1001.      set this to "Yes" then any blanks at the beginning or end of
  1002.      the fields contents will not be printed at run time. This
  1003.      facility is used mainly for inserting numbers or names into
  1004.      form letter text.
  1005.      Press F2 to accept the defaults. The area which the field will
  1006.      occupy is shown on screen. Now move the cursor to the right and
  1007.      place the other two fields. Finally, press the return key to
  1008.      take the cursor to a new line and type a full stop ".".  The
  1009.      section names menu appears again.  This time select "End".
  1010.      The format screen now looks like this.
  1011.      .List Items
  1012.           
  1013.      .End
  1014.      Press F2 to save the format. When you do, a new menu will pop
  1015.      up with four choices for the output destination. The exact
  1016.      meanings of these selections will be discussed shortly.  For
  1017.      the moment select "Output to Screen". When the Procedures menu
  1018.      appears select item 7 and save your procedure to disk.
  1019.      Now select item 6 and run the procedure.
  1020.      The fields from each record of the "Aircraft" form are listed
  1021.                                  - 23 -
  1022. ................................................................................
  1023.      down the screen. When the list reaches the bottom line the
  1024.      screen starts to scroll.  When all records have been listed the
  1025.      screen returns to the start of the list from where you can
  1026.      browse the report. If the list is long you can pause the output
  1027.      by pressing the return key while it is still running. Once the
  1028.      report is complete you can browse through it using the PgUp,
  1029.      PgDn and arrow keys.  You can also use the text search facility
  1030.      at F3.
  1031.      When you have finished reading the report press Escape to
  1032.      return to the procedures menu.  You can browse the report again
  1033.      at any time by selecting item 10 (Recall Last Output). Try it
  1034.      now.  While browsing a report you can also print it out by
  1035.      pressing F10.  If you press F10 to print a report from browse
  1036.      mode you invoke a low level print driver which prints the
  1037.      report at 10 CPI, 6 LPI in draft mode. Other font sizes and
  1038.      effects such as Bold and Underline are only available when you
  1039.      direct the report output to the printer at run time.
  1040.      To try printer effects select "Edit Procedure Code" and change
  1041.      The code to:-
  1042.      Declare output fields
  1043.         Aircraft.knownas : Aircraft.mark : Aircraft.type
  1044.      end
  1045.      Bold on
  1046.      12 CPI
  1047.      for aircraft
  1048.         print list items
  1049.      next
  1050.      Save the new code and select "Edit Output Format". There is
  1051.      nothing to change in the format itself but when you press F2 to
  1052.      save it, this time choose "Choose at Run time" for the output
  1053.      destination.
  1054.      When you now select "Run Procedure", the computer will beep and
  1055.      you will be asked whether the output is to be to the screen or
  1056.      printer. Choose printer and easy base will print your report in
  1057.      bold at 12 characters to the inch. (Assuming you have installed
  1058.      the correct printer driver from the utilities menu)
  1059.      You will notice that while Easy Base was printing your report
  1060.      it also output it to the screen but on completion it returned
  1061.      you to the procedures menu without invoking Browse mode.
  1062.      The output destinations which you choose when saving the output
  1063.      format are not "Either or" choices.  Irrelevant of your choice
  1064.      the output is always sent to both the screen and the disk file.
  1065.      It is the disk file that you browse when you select "Recall
  1066.      Last Output".  The differences between the choices are that
  1067.      only an output to the screen invokes Browse mode on completion
  1068.                                  - 24 -
  1069. ................................................................................
  1070.      and only an output to printer prints the report. Output to disk
  1071.      is only selected if you want to update reports from a Batch
  1072.      Execute menu.
  1073.      Now let's try something a bit more interesting. So far the
  1074.      report simply lists the aircraft in the order in which the
  1075.      records were filed.  To list them in alphabetic order, edit the
  1076.      procedure code and change the "For" line to:-
  1077.      for aircraft with knownas in order
  1078.      Save the code.  Easy Base can only list in order if the field
  1079.      you wish the order to be done by is indexed.  If the field you
  1080.      have chosen is not indexed you will get an error message.  If
  1081.      this happens, save the code by pressing the Escape Key - Save
  1082.      the procedure at item 7 then return to form design.  Load your
  1083.      form - edit the attributes for the field changing Indexed to
  1084.      "Yes".
  1085.      You can now reload your procedure and run it. This time the
  1086.      aircraft names will be in alphabetic order.
  1087.      Because a procedure has up to three parts it may not at this
  1088.      stage be obvious how Easy Base is handling the "Saving" or
  1089.      "Abandoning" of separate parts.  Here is a quick explanation.
  1090.      If you escape from either the output format or later the input
  1091.      screen and choose to "abandon" it you are abandoning it in the
  1092.      version of the report you are editing only. If you escape from
  1093.      the procedures menu and choose to "abandon" the procedure then,
  1094.      if it is a new "Untitled" procedure it is lost but if it is a
  1095.      procedure which you have loaded for editing then it is only the
  1096.      edits which are abandoned - The original procedure remains
  1097.      unchanged on disk. A procedure which you have loaded for
  1098.      editing is only changed on disk when you save it with item
  1099.      seven from the procedures menu.  At any time during the editing
  1100.      of a procedure you can throw away all your edits and return to
  1101.      the original version by reloading it from disk and replying
  1102.      "No" when you are asked if you wish to save the currently
  1103.      loaded version.
  1104.      Suppose now that we wished to list the aircraft in groups by
  1105.      type - all the bombers together - all the fighters together
  1106.      Etc.
  1107.      To do this, edit the procedure code again and change the "For"
  1108.      line to: -
  1109.      for aircraft with type in order
  1110.      This time, when the report is run, all the airliners come first
  1111.      followed by the bombers etc. but the group field "Airliner" ,
  1112.      "Bomber" etc. is listed on each line and it would be much
  1113.                                  - 25 -
  1114. ................................................................................
  1115.      neater if it could be separated or printed in Bold or
  1116.      underline.
  1117.      Edit the code again, this time to:-
  1118.      Declare output fields
  1119.         Aircraft.knownas : Aircraft.mark : Aircraft.type
  1120.      end
  1121.      declare variables
  1122.        lasttype as text
  1123.      end
  1124.      for Aircraft with type in order
  1125.         if aircraft.type <> lasttype then print group header
  1126.         lasttype = aircraft.type
  1127.         print list items
  1128.      next
  1129.      In this code we have introduced a text variable "lasttype".
  1130.      During the "For" loop the list items will be printed on each
  1131.      iteration but the group header will only be printed when the
  1132.      type changes
  1133.      Now edit the output format to:-
  1134.      .group header
  1135.          
  1136.      .list items
  1137.                  
  1138.      
  1139.      .end
  1140.      The group header starts with a blank line which will separate
  1141.      the groups. It contains only the "Type" field.  The list items
  1142.      section contains the "Knownas" and mark fields.
  1143.      When you run this report the output will be:-
  1144.         Airliners
  1145.                 Boeing 707
  1146.                 Dehaviland Comet     Mk4
  1147.                 Boeing Jumbo Jet     747
  1148.         Bombers
  1149.                 Boeing B52
  1150.                 Avro Vulcan
  1151.                 Avro lancaster       2
  1152.      If you want the group header to be in bold or underline then
  1153.      all you have to do is insert the on and off commands before and
  1154.      after the "Print group header" command using the block If then
  1155.      construction.
  1156.                                  - 26 -
  1157. ................................................................................
  1158.      Declare output fields
  1159.         Aircraft.knownas : Aircraft.type : Aircraft.mark
  1160.      end
  1161.      declare variables
  1162.         lasttype as text
  1163.      end
  1164.      for Aircraft with type in order
  1165.         if aircraft.type <> lasttype then
  1166.            bold on : underline on
  1167.            print group header
  1168.            bold off : underline off
  1169.         end if
  1170.         print list items
  1171.      next
  1172.      As a beginner, you are probably wondering about the reason for
  1173.      the indentations after the "for" and "if" lines. The code will
  1174.      work perfectly well without them. When you come to write more
  1175.      advanced procedures you will have many For loops, Do Loops and
  1176.      If conditions interwoven with each other.  If each has its own
  1177.      indentation then you will be able to see at a glance which
  1178.      commands occur within which loops and conditions and your code
  1179.      will be very easy to read and edit.
  1180.      Going back to the "Aircraft" listing procedure, we now have
  1181.      each group separated but the aircraft names themselves are no
  1182.      longer in alphabetic order.  This is because we changed index
  1183.      files when we selected "With Type in order".  It is now the
  1184.      "Type" groupings which are in alphabetic order.  Suppose that
  1185.      we want to keep this grouping but still list the aircraft in
  1186.      each group with their names in order.  Neither of the index
  1187.      files on the "Knownas" or "Type" fields can produce this order.
  1188.      We need a combined or "Compound" index on both fields
  1189.      To construct this index, save the present procedure and return
  1190.      to form design.  Load the "Aircraft" form and add a new field
  1191.      anywhere on it. Assuming the length of the "Knownas" field as
  1192.      45 and the length of the "Type" field as 14 the new fields
  1193.      attributes are:-
  1194.      Name         Typename
  1195.      Type         Text
  1196.      Length       59
  1197.      Mandatory    No
  1198.      Unique       No
  1199.      Indexed      Yes
  1200.      User Entry   No
  1201.      Display      Invisible
  1202.      Derived      Yes
  1203.      The derivation formula is:-
  1204.      Jointext(spacepad(type,15),knownas)
  1205.                                  - 27 -
  1206. ................................................................................
  1207.      Test that the derivation formula is correct by pressing F5 for
  1208.      test mode. When you type a name into the "Knownas" field and a
  1209.      type in the "Type" field the new field should derive as a
  1210.      combination of the two.
  1211.      Escape from test mode and press F2 to save the form. Easy Base
  1212.      will first re-format the data file to incorporate the new field
  1213.      and then write the new index file.
  1214.      When this is complete, return to the procedure and edit the
  1215.      "For line of the code from:-
  1216.      For aircraft with type in order
  1217.      to
  1218.      For Aircraft with typename in order
  1219.      No change is necessary to the output format.  The output will
  1220.      be laid out as before but the names in each group will be in
  1221.      alphabetic order.
  1222.      To "Polish" the "Aircraft" report it would be nice if it had a
  1223.      heading. We would also like to prevent the list from running
  1224.      off the end of the page when printed and add a page number at
  1225.      the foot of each page.
  1226.      To do these things edit the code to:-
  1227.      Declare output fields
  1228.         Aircraft.knownas : Aircraft.type : Aircraft.mark
  1229.         page number                  'New Field
  1230.      end
  1231.      Declare variables
  1232.         lasttype as text
  1233.      end
  1234.      bold on
  1235.      print report header
  1236.      for aircraft with typename in order
  1237.         if bottom margin < 1 then
  1238.            bold on : print page footer
  1239.            page feed : print page header : bold off
  1240.         end if
  1241.         if aircraft.type <> lasttype then
  1242.            bold on : underline on
  1243.            print group header
  1244.            bold off : underline off
  1245.         end if
  1246.         print list items
  1247.      next
  1248.      print report footer
  1249.                                  - 28 -
  1250. ................................................................................
  1251.      Now edit the output format to:-
  1252.      .Report header
  1253.          
  1254.                      AIRCRAFT LIST BY TYPE
  1255.          
  1256.      .Group Header
  1257.          
  1258.      .List Items
  1259.                  
  1260.      
  1261.      .Page header
  1262.          
  1263.                   Aircraft List By Type (Cont)
  1264.          
  1265.      .Page Footer
  1266.                              - 
  1267.      .Report Footer
  1268.          
  1269.      .End
  1270.      The new print sections Report Header, Report Footer, and Page
  1271.      Header contain only fixed text.  The new section Page Footer
  1272.      contains the new field "page number" and the "Trim trailing
  1273.      spaces" attribute should be set to "Yes" in this.  This will
  1274.      keep the correct spacing of   - 9 -    and   - 10 -    when the
  1275.      page numbers are printed.
  1276.      So far all the fields we have printed are from the same form
  1277.      "Aircraft".  Suppose that we also wanted to list the country of
  1278.      origin for each aircraft.  The "Aircraft" form does not hold
  1279.      this information but the "Manufacturers" form has a field
  1280.      "Nationality". To incorporate this field into the report all we
  1281.      have to do is declare it as an output field and then arrange to
  1282.      have that field in memory when we print the list items. We can
  1283.      load the correct record from the "Manufacturers" form by using
  1284.      the linking data "Name" in the manufacturers form and
  1285.      "Manufacturer" in the "Aircraft" form.  This is a similar
  1286.      process to looking up data except that a pre defined
  1287.      relationship is not necessary. We can tell Easy Base exactly
  1288.      what we want within the code.
  1289.      Declare output fields
  1290.         Aircraft.knownas : Aircraft.type : Aircraft.mark
  1291.         Manufacturers.nationality : Page number
  1292.      end
  1293.      Declare variables
  1294.         Lasttype as text
  1295.      end
  1296.                                  - 29 -
  1297. ................................................................................
  1298.      '.....................PRINT REPORT HEADING...
  1299.      print report header
  1300.      '.................
  1301.      for aircraft with typename in order
  1302.         '..................PRINT HEADERS AND FOOTERS...
  1303.         if bottom Margin < 1 then
  1304.            bold on : print page footer
  1305.            page feed : print page header : bold off
  1306.         end if
  1307.         '..................PRINT GROUP HEADERS.........
  1308.         if aircraft.type <> lasttype then
  1309.            bold on : underline on
  1310.            print group header
  1311.            bold off : underline off
  1312.         end if
  1313.         '...............LOAD MANUFACTURERS NATIONALITY..
  1314.         for manufacturers with name = aircraft.manufacturer
  1315.            Print list items
  1316.         next
  1317.         '..............
  1318.      next
  1319.      print report footer
  1320.      Because the procedure code is becoming longer, remarks are
  1321.      added to make it easier to see which parts of the code do what.
  1322.      You can add remarks to your code anywhere by prefixing them
  1323.      with an apostrophe.
  1324.      At the point where we are about to print the list items we
  1325.      start another "For" loop.  This time "For Manufacturers".  When
  1326.      one "For" loop is "Nested" within another, the record currently
  1327.      loaded by the first loop remains in memory while the records
  1328.      selected by the "Nested" loop are processed and all the fields
  1329.      of both records are available at the same time.
  1330.      As we have qualified the "Manufacturers" loop:-
  1331.      for manufacturers with name = aircraft.manufacturer
  1332.      only the single record in which the "Name" field matches the
  1333.      "Aircraft.manufacturer" field which is currently loaded by the
  1334.      outer loop will be selected from the "Manufacturers" form.
  1335.      While we have both the required records in memory we print the
  1336.      list items.
  1337.      All that remains to do now is to edit the output format and add
  1338.      the "Manufacturers.nationality" field to the .List Items
  1339.      section.
  1340.                                  - 30 -
  1341. ................................................................................
  1342.      By nesting loops in this way, you can list data from any number
  1343.      of different forms which have "Linking" data in one of their
  1344.      fields.  Where only one record matches as in the example above
  1345.      then the required fields go in the .List items section with the
  1346.      other fields.  Where there are many matches (Related list) the
  1347.      fields from the secondary loop have their own print section.
  1348.      (See example on page 5)
  1349.      Now we can print any of the fields from any "Related" forms in
  1350.      any order.  We are still, however, listing all the records from
  1351.      the "Aircraft" form and we may for example only wish to print
  1352.      those records which are in the "Bomber" group.
  1353.      Start a new procedure and enter the code:-
  1354.      Declare output fields
  1355.         Aircraft.knownas : Aircraft.type : Aircraft.base
  1356.      end
  1357.      for aircraft with type = "Bomber"
  1358.         print list items
  1359.      next
  1360.      Create the output format placing the three output fields within
  1361.      the .List Items section.
  1362.      When you run this report, only the bombers will be listed but,
  1363.      once more, the aircraft names will be in the order in which
  1364.      they were entered to the form.
  1365.      To get them in alphabetic order we must again use the compound
  1366.      index on the "Typename" field. This time we have to ensure that
  1367.      the loop starts with the first "Bomber" and ends with the last
  1368.      "Bomber".
  1369.      Declare output fields
  1370.         Aircraft.knownas : Aircraft.type : Aircraft.base
  1371.      end
  1372.      declare variables
  1373.         group as text
  1374.      end
  1375.      group = "Bomber"
  1376.      for aircraft with typename > "Bomber"
  1377.         if aircraft.type <> group then exit for
  1378.         print list items
  1379.      next
  1380.      Before starting the "For" loop we set a variable "Group" to the
  1381.      value "Bomber". The "For" loop is then qualified such that the
  1382.      records will be processed with "Typename" in order but starting
  1383.      with the first occurrence of "Bomber" in the field.  To stop
  1384.      the loop when all the bombers have been processed we test the
  1385.      contents of the "Aircraft.type" field on each iteration of the
  1386.                                  - 31 -
  1387. ................................................................................
  1388.      loop and when the first record is loaded which is not a bomber
  1389.      we stop processing the loop with the command "Exit For".
  1390.      As in the first procedure, we could now add Page headers, Page
  1391.      footers and number the pages Etc.
  1392.      Suppose however that having created this procedure we now
  1393.      wanted a list of all the "Airliners".
  1394.      We could achieve this by changing "Bomber" to "Airliner" within
  1395.      the code but this would be time consuming. It would be much
  1396.      better if we could tell Easy Base which type group we wanted at
  1397.      the start of the procedure and have Easy Base make the
  1398.      necessary changes.
  1399.      To supply "Variables" to a procedure before running we use an
  1400.      "Input Screen", the third part of a procedure.  Save the code
  1401.      and select item 3 (Create Input Screen) from the procedures
  1402.      menu.
  1403.      As soon as you select item 3 Easy Base will ask if you wish to
  1404.      copy an existing form. Type "N" for no.  The next screen will
  1405.      be familiar to you.  It is exactly the same as the form design
  1406.      screen.
  1407.      When you first designed your forms, the form design routine
  1408.      performed two tasks. It created your form and also a default
  1409.      input screen from which to enter data. Now that you are about
  1410.      to create input screens for procedures, the same routine is
  1411.      used to design the screen.  It does not, of course, create a
  1412.      parallel form.
  1413.      All the facilities for "Polishing" your forms - all the
  1414.      facilities for deriving, calculating looking up and testing
  1415.      derivations which you had in Form Design are also available for
  1416.      Input Screen design.
  1417.      The only difference you will notice is that when you define a
  1418.      field, the "Unique" and "Indexed" attributes are marked "Not
  1419.      Applicable" and when you run the procedure, only the "Options"
  1420.      "Clear Screen after Running Procedure" and "Clear Field on
  1421.      Editing" are available.
  1422.      Move the cursor to somewhere near the middle of the screen and
  1423.      type:- "Which Aircraft type would you like listed".  Then press
  1424.      F10 to define a field.
  1425.      If, in the aircraft form the "Type" field had been defined as a
  1426.      choice field, then we would define this field as a choice field
  1427.      and use the same list.
  1428.      If, on the other hand the "Type" field in the "Aircraft" form
  1429.                                  - 32 -
  1430. ................................................................................
  1431.      looked up its contents from a core data form containing the
  1432.      type names then we would set the attributes:-
  1433.      Name            type
  1434.      Data type       text
  1435.      Field Length    15    (Same as the "Type" field in "Aircraft")
  1436.      Mandatory       Yes
  1437.      User Entry      Yes
  1438.      Display         Field  (or text or Alt colours as you wish)
  1439.      Derived         No
  1440.      The field will of course be derived:- Lookup(Aircraft,type)
  1441.      but as we have not yet entered the relationship, we will leave
  1442.      the derived attribute set to "No" to prevent an error message
  1443.      when we save the screen.
  1444.      Save the screen.  When you do, you will be asked to select
  1445.      between "Repeat Screen after F2" and "Run Once and Exit".
  1446.      If you choose the first option then the procedure will repeat
  1447.      until you press the Escape Key. If you choose the second
  1448.      option, control will return to the procedures menu after the
  1449.      report has been run.
  1450.      Now save the procedure.  Let's call it "Aircraft By Type".
  1451.      You may have noticed that all Form, Field and Procedure names
  1452.      so far have been single words.  There is no restriction on
  1453.      using multiple words in names but single ones make code much
  1454.      easier to read. The only good reason to use more than one word
  1455.      is in a reporting procedure name. After the procedure has been
  1456.      run the status line in Browse mode will be "Procedure:-
  1457.      Aircraft By Type" which makes more sense to an end user than
  1458.      "Procedure:- ACbytyp".
  1459.      Now go to Relationships and enter the relationship "Aircraft"
  1460.      between "Aircraft by Type" and "Aircraft" linking the two
  1461.      fields "Type".
  1462.      Reload the "Aircraft by Type" procedure and edit the Input
  1463.      screen setting the derived attribute to "yes" and entering the
  1464.      derivation formula:-  Lookup(aircraft,type)
  1465.      Save the screen again and select "Edit Procedure Code".
  1466.      To use the Input screen quickly you could change the two
  1467.      occurrences of "Bomber" to input.type. However, now that we
  1468.      have an input.type field the variable "group" is superfluous.
  1469.      The finished procedure code and Output format are shown on the
  1470.      next page.
  1471.                                  - 33 -
  1472. ................................................................................
  1473.      Declare output fields
  1474.         Aircraft.knownas : Aircraft.base
  1475.         Page number : input.type
  1476.      end
  1477.      Print report header
  1478.      for aircraft with typename > input.type
  1479.         if bottom margin < 1 then
  1480.            print report footer
  1481.            page feed : print page header
  1482.         end if
  1483.         if aircraft.type <> input.type then exit for
  1484.         print list items
  1485.      next
  1486.      print report footer
  1487.      page feed
  1488.      ......................Output Format.........
  1489.      .Report Header
  1490.             
  1491.                           
  1492.  LIST
  1493.                           
  1494.                 Name                   Built at
  1495.             
  1496.      .Page header
  1497.             
  1498.                 Name                   Built at
  1499.             
  1500.      .List items
  1501.                 
  1502.      .Page Footer
  1503.                              - 
  1504.      .Report Footer
  1505.             
  1506.      .End
  1507.      The field in the Report header is input.type.  The fields in
  1508.      the list items are Aircraft.knownas and Aircraft.base.
  1509.      The field in the page footer is Page number.
  1510.      Suppose now that we print out the report and find that we had
  1511.      entered all the "Aircraft" "Knownas" fields in Upper case and
  1512.      all the "Base" fields in Lower case.  This would make the
  1513.      report quite untidy.  There is no need however to change the
  1514.      original data. To print both fields in Upper case all we need
  1515.      to do is alter each of the "Base" field contents using the
  1516.      "Upper" Function before printing it.
  1517.      To do this insert the line:-
  1518.                                  - 34 -
  1519. ................................................................................
  1520.         aircraft.base = upper(aircraft.base)
  1521.      immediately before the print list items command.
  1522.      As well as simply "Listing" data you can manipulate it in many
  1523.      different ways.  You can do any form of arithmetic on numeric
  1524.      fields and you can alter text, date and time fields with over
  1525.      fifty different functions.
  1526.      A function is a small internal routine which returns a value
  1527.      derived from one or more other values (Parameters) which you
  1528.      supply.  For Example, in the code line:-
  1529.      date = datetext(invoice.date)
  1530.      "Datetext" is a function to which you are passing the parameter
  1531.      "Invoice.date".  If invoice.date is 02/02/94 then the function
  1532.      "Datetext" will derive the text "2nd February 1994" and
  1533.      "Return" this as if it were a variable. The output field "Date"
  1534.      will therefore become "2nd February 1994".
  1535.      A functions parameters are always passed to it enclosed in
  1536.      brackets.  If there are more than one then they are separated
  1537.      by commas.
  1538.      The next section of the Manual introduces you to Procedures
  1539.      which perform transactions.  You should now read the
  1540.      descriptions of the following commands in the Programmers
  1541.      Reference.
  1542.      Copy All From
  1543.      Delete Record
  1544.      Clear Records From
  1545.      Update Record
  1546.      Pause On/Off
  1547.      Escape On/Off
  1548.      Together with the field control "Beep".
  1549.      Note:
  1550.      From Version 7 Procedures with input screens can be innitiated
  1551.      with any of the function keys 2,4,5,,7,8,9 or 10
  1552.      See Programmers Ref. Procedure command "Run"
  1553.                                  - 35 -
  1554. ................................................................................
  1555.                      PROCEDURES (TRANSACTIONAL)
  1556.      In Data Entry you make a "Transaction" when you add, update or
  1557.      delete a record.  You can make the same transactions in
  1558.      procedures.  There are, however, two major advantages to
  1559.      making your transactions via procedures.
  1560.      1.   You control which transactions can and cannot be made.
  1561.      2.   You can make any number of different transactions in any
  1562.           number of different forms.
  1563.      Consider the "Customers" form.  You would want any of your
  1564.      staff to be able to add a new customer in your absence. If you
  1565.      allow them to do this in Record Entry then they could also
  1566.      (deliberately or inadvertently) alter or delete other customers
  1567.      records.
  1568.      To prevent this, create a new procedure.  Create an input
  1569.      screen.  When you are asked if you wish to copy an existing
  1570.      form - reply "Yes" and select the customers form.  Save the
  1571.      input screen and select Create Procedure Code. Now enter the
  1572.      procedure code:-
  1573.      for customers new record
  1574.         copy all from input
  1575.      next
  1576.      Save the procedure - Let's call it "Enter customers".  You can
  1577.      now call this procedure from your "User Menus" described in the
  1578.      next section and your staff will be able to enter new customers
  1579.      without the opportunity to make any other transactions.
  1580.      You can also control parts of a transaction.  If your
  1581.      "Customers" form had a field for "Creditlimit" then, in the
  1582.      form, you would wish to be able to enter any credit limit you
  1583.      wanted, but you might wish to restrict the amount your staff
  1584.      could enter for a new customer.
  1585.      To do this you simply edit the field attributes for the
  1586.      "Creditlimit" field in the input screen.
  1587.      To set a fixed credit limit of say 
  1588. 500.00 set the user entry
  1589.      attribute to "No", the derived attribute to "Yes" and enter the
  1590.      derivation formula:- 500.
  1591.      To restrict the entry to a maximum of say 
  1592. 1000.00 you would
  1593.      leave the user entry attribute set to "yes" but derive the
  1594.      field:-  If(creditlimit > 1000,blank[beepMaximum credit 
  1595.               for new customers],creditlimit)
  1596.      There might also be fields on the "Customers" form which are
  1597.                                  - 36 -
  1598. ................................................................................
  1599.      irrelevant to the transaction of adding a new customer.  You
  1600.      might also have fields for personal comments which you do not
  1601.      wish your staff to see.  You can simply delete these from the
  1602.      input screen or change them to invisible.
  1603.      In other words you can limit a transaction in any way you wish
  1604.      and the final input screen can be totally different to the
  1605.      original form.
  1606.      Transaction procedures which delete or update records are
  1607.      created in a similar manner but are slightly more complicated.
  1608.      To create a procedure which allows your staff to delete
  1609.      customers, you would again copy the customers form as the input
  1610.      screen.  This time, the only field to which you allow User
  1611.      Entry is the "acountno" field.  You enter a relationship
  1612.      between this report and the "Customers" form linking "acountno"
  1613.      and derive all the other fields you wish to show as:-
  1614.      lookup(customers,name)
  1615.      lookup(customers,address)
  1616.      Etc.
  1617.      Your staff now enter the account number to be deleted. The
  1618.      other "looked up" fields are only there so that the name and
  1619.      address will appear confirming that the correct account number
  1620.      has been entered.
  1621.      The procedures code to delete the record is:-
  1622.      for customers with acountno = input.acountno
  1623.         delete record
  1624.      next
  1625.      As with the procedure to add a record you are still in complete
  1626.      control of what can or cannot be done.  Suppose that you had a
  1627.      field on the "customers" form which you kept updated with his
  1628.      account balance.  You would not want anyone to delete a
  1629.      customer who still had an outstanding balance on his account.
  1630.      To prevent this, just change the derivation for the "balance"
  1631.      field to :-
  1632.      if(lookup(customers,balance) <> 0,blank[beepCustomers cannot be
  1633.      deleted until their A/C is clear],0)
  1634.      You would also set the Mandatory attribute to "Yes" to prevent
  1635.      anyone from ignoring the warning.
  1636.      If you wanted a procedure which allowed staff to change a
  1637.      customers address but no other fields, then you would create
  1638.      the same input screen as for the delete record and the same
  1639.                                  - 37 -
  1640. ................................................................................
  1641.      relationship but this time you would allow user entry to the
  1642.      address field and derive it:-
  1643.      Default(lookup(customers,address))
  1644.      When the operator enters the account number for the customer
  1645.      whose address he wishes to change, the old address will appear
  1646.      to confirm that he has the right customer, but he will be able
  1647.      to edit it.
  1648.      The procedure code would be:-
  1649.      for customers with acountno = input.accountno
  1650.         customers.address = input.address
  1651.         update record
  1652.      next
  1653.      The second advantage of making transactions via procedures is
  1654.      that you can perform several tasks at once. Consider a Video
  1655.      Library hiring films to its members. There will be a form for
  1656.      the films, one for the members and one for daily takings.
  1657.      The procedure used for hiring out the films will have an input
  1658.      screen with a field for the members number, possibly three
  1659.      fields for the film numbers being hired, three more fields in
  1660.      which the films rental prices are looked up and one in which
  1661.      these three fields are totalled.  When the operator runs the
  1662.      procedure all the necessary transactions are performed by the
  1663.      procedure code:-
  1664.      for members with number = input.member
  1665.         if input.film1 <> blank then members.film1 = input.film1
  1666.         if input.film2 <> blank then members.film2 = input.film2
  1667.         if input.film3 <> blank then members.film3 = input.film3
  1668.         update record
  1669.      next
  1670.      if input.film1 <> blank then
  1671.         for films with number = input.film1
  1672.            films.hiredto = input.member
  1673.            films.datehired = system date
  1674.            update record
  1675.         next
  1676.      end if
  1677.      for daily takings
  1678.         total = total + input.total
  1679.         update record
  1680.      next
  1681.      The mid section of the code updating film1's record would of
  1682.      course be repeated for film2 and film3 but has been omitted for
  1683.      clarity.
  1684.                                  - 38 -
  1685. ................................................................................
  1686.                             USER MENUS
  1687.      Once you have created forms and procedures you can create an
  1688.      end user menu system to run them.  You could wait till all your
  1689.      procedures are finished but you will get a much better feel for
  1690.      how your program is developing if you start and use a menu
  1691.      system as you go.  Easy Base includes a User Menu call to its
  1692.      system menus so you can work from your own developing menu
  1693.      system while you are still developing your program.
  1694.      Select "Menus" from the main menu and have a look at the
  1695.      screen.  The Menus screen is an internal form just like the
  1696.      ones you have created. You have all the same facilities to
  1697.      enter, update and delete menus that you have in Data Entry to
  1698.      one of your own forms.
  1699.      Let's create a menu based on some of the forms and procedures
  1700.      previously discussed.
  1701.      The first field on the menus form is "Menu Name".  This is the
  1702.      unique field and a name must be supplied.  We'll call it
  1703.      "Customers".  The next field is "Menu Type". This is a choice
  1704.      field with two options, "Normal" and "Batch Execute".  The
  1705.      "Batch Execute" option will be discussed later.  For now,
  1706.      select "Normal".
  1707.      The third field is "Menu Title". Whatever you enter here will
  1708.      be displayed as a title (or heading) above your menu.
  1709.      The fourth field which is untitled on the screen is a choice
  1710.      field with the options, "Run on Number Key" and "Run on Return
  1711.      Key".  If you choose the first option then the items on your
  1712.      menu will be run as soon as the item number is pressed and if
  1713.      you choose the second option then typing the item number will
  1714.      move the highlight bar to the selection but the item will not
  1715.      be called until the return key is pressed.  In either case you
  1716.      will still be able to select items with the cursor control keys
  1717.      The next field asks for a "Sign on password" if a startup menu.
  1718.      You can start your application (program) on any menu that has
  1719.      a sign on password by restarting Easy Base and using that
  1720.      password instead of your developers password.  In this case we
  1721.      are going to menu the reports which add, delete and alter a
  1722.      customers address. This will be a sub menu so we leave this
  1723.      field blank.
  1724.      The main section of the "Menus" form has three columns of nine
  1725.      fields.  The first column is for the text to be displayed on
  1726.      the menu.  The second is for the type of action (function)
  1727.      which is to be called.  The third is for the individual item.
  1728.                                  - 39 -
  1729. ................................................................................
  1730.      With the cursor in the first text field we type:-
  1731.      Enter a New Customer      and press return.
  1732.      As soon as the cursor moves to the first "Function" field a
  1733.      menu appears listing all the different functions that can be
  1734.      called.  The first four choices allow you to:-
  1735.      1.   Run one of your procedures.
  1736.      2.   Recall the last output from one of your procedures.
  1737.      3.   Call the data entry screen for one of your forms.
  1738.      4.   Call another of your menus.
  1739.      The other functions are selected utilities from the system
  1740.      utilities menu which you may wish to provide to the
  1741.      end user without allowing him access to the entire system.
  1742.      Select "Run Procedure" and press return.
  1743.      When the cursor moves to the "Item" column Easy Base will list
  1744.      all your procedures. Choose "Enter customers".
  1745.      on the next two lines enter:-
  1746.      Delete Existing Customer   Run Procedure    Delete Customers
  1747.      Change Customers Address   Run Procedure    Address Change
  1748.      and press F2 to save the menu.
  1749.      Now let's make a start to the main "Startup" menu.  We may not
  1750.      have any procedures to put on it yet but we can get started
  1751.      with an item to call data entry to "Customers" and one to call
  1752.      the "Customers" sub menu.
  1753.      Fill in a new menus record using the name "Main Menu", Type
  1754.      "Normal" and Title "- M A I N   M E N U -".  This time enter a
  1755.      startup password, say "Fred".  Complete the Items section
  1756.      with:-
  1757.      Customers Records          Data Entry       Customers
  1758.      Customer Updates           User Menu        Customers
  1759.      Program Development        System menus
  1760.      Press F2 to save this menu then press escape all the way out to
  1761.      the DOS prompt (or your hard disk menu system).  Restart Easy
  1762.      Base.  This time, when the sign on screen appears, enter "Fred"
  1763.      and press return.
  1764.      Instead of the system menus, you will see your "Main Menu".
  1765.      If you select item 1 the "Customers" form will come up. If you
  1766.      select item 2 your sub menu will be overlaid and you can run
  1767.      any of the three procedures on it.  If you select item 3 you
  1768.                                  - 40 -
  1769. ................................................................................
  1770.      will be transferred to the Easy Base System menus where you can
  1771.      continue with the development of your program.
  1772.      Whenever you create new procedures or forms you can add them to
  1773.      your menu system.
  1774.      Suppose you would like the utilities, Backup Data, Restore Data
  1775.      and Install Printer to be available from your menu system.
  1776.      Create a new menu, let's call it "Utilities" with the items:-
  1777.      Backup data to disk        Backup Data
  1778.      Restore data from disk     Restore Data
  1779.      Install Printer            Install Printer
  1780.      Save this new menu then edit your main menu to include the new
  1781.      item:-
  1782.      Utilities                  User menu           Utilities
  1783.      When you have called the Easy Base system menus from one of
  1784.      your own menus then pressing escape does not exit the program,
  1785.      it returns you to your own menu.  You close down by pressing
  1786.      escape from your main menu.  When you get back to your "Main
  1787.      Menu" you will notice that the new "Utilities" item is not
  1788.      there. New Menu items cannot be added while the program is
  1789.      running. To incorporate the "Utilities" item you must again
  1790.      exit the program and restart with the password "Fred".
  1791.      As your program develops you can create as many menus as you
  1792.      need. Your "Main Menu" can call up to nine sub menus. Each of
  1793.      those can call another nine sub sub menus Etc Etc. You can also
  1794.      have additional startup menus with different passwords. These
  1795.      can either run completely different menus or can restrict
  1796.      different parts of the menu system to different users.
  1797.      When you start up on one of your menus systems Easy Base
  1798.      creates a default "Tree" structure for it.  From whichever menu
  1799.      is on screen the escape key backsteps down the tree until you
  1800.      reach your "Main Menu" and then exits the program.
  1801.      If one of the "forward" menu calls crosses branches, ie it
  1802.      calls a menu which is also called from a lower level then
  1803.      subsequent presses of the escape key backstep down the current
  1804.      branch and not back "cross tree".
  1805.      You can also make menu calls from low to high levels. (a sub-
  1806.      sub- sub menu can have an item which calls the main menu).
  1807.      In some circumstances you may prefer a hierarchical rather than
  1808.      a tree structure where the main menu is recalled after each
  1809.      individual procedure.  To accomplish this, each final item is
  1810.      placed on its own menu followed by a call to the main menu and
  1811.                                  - 41 -
  1812. ................................................................................
  1813.      the menu type is changed to "Batch Execute".
  1814.      When you create a "Batch Execute" menu then instead of
  1815.      displaying a menu for you to choose from, Easy Base
  1816.      executes each item on the menu in sequence and then returns to
  1817.      the menu which called it.
  1818.      With batch execute menus you can automate many of the processes
  1819.      in your application.  If you have several printouts to be done
  1820.      each day you can have them all done from batch execute menus.
  1821.      Similarly, if you need to update many reporting procedures for
  1822.      later "Recall" to the screen, these can all be done at once.
  1823.      There is no limit to the number of procedures which can be
  1824.      batched - One batch menu can call another.
  1825.      If you create a "Startup" batch menu then, provided it does not
  1826.      call a "Normal" menu, Easy Base will perform all the tasks on
  1827.      the menu and then exit to DOS.
  1828.      If you create a "Startup" batch menu which eventually calls a
  1829.      "Normal" menu then the batch process stops at that point and
  1830.      the "Normal" menu becomes the main (root) menu.  Pressing
  1831.      escape from this menu exits to DOS. it never returns to the
  1832.      startup batch menu which called it
  1833.      Start up batch menus are useful for running regular daily
  1834.      procedures and for forcing the user to check the system date
  1835.      and time.
  1836.      There are many other uses for batch execute menus.  You can
  1837.      automate menu changes. If, for example, running one particular
  1838.      procedure is invariably followed by  running one from a choice
  1839.      of three others then the menu containing the others can be
  1840.      batched after the first procedure.
  1841.      In Easy Base you can create quite long and complex procedures
  1842.      but they are eventually limited by memory constraints.  If you
  1843.      ever run out of memory creating a long procedure then just
  1844.      split it and batch the parts.
  1845.      Don't forget to set the output of non print reports to "Disk"
  1846.      otherwise Browse Mode will be invoked.
  1847.                                  - 42 -
  1848. ................................................................................
  1849.                       EXTERNAL FILE ACCESS
  1850.      In order to provide flexible import and export to data files
  1851.      external to your applications, Easy Base includes a complete
  1852.      set of low level file access commands. :- Open, Close, Seek
  1853.      Read, Write, Find, Shell and Erase.
  1854.      Full details of the commands and how to use them are given in
  1855.      the programmers reference but please read the following notes.
  1856.      You can only open one external file at a time but you can
  1857.      transfer data either way between it and any number of Easy Base
  1858.      files.
  1859.      You can open any number of external files within one procedure
  1860.      but you must close each before you open the next.
  1861.      In Easy Base all data is converted to a common type for
  1862.      processing. Within the system this has the advantage that you
  1863.      never need to worry about what type of data you are handling.
  1864.      You can assign a text field's value to a numeric field and you
  1865.      can assign the result of a calculation to a text field.
  1866.      However, in order to do this Easy Base pre processes text
  1867.      variables. If you are accustomed to file access, string
  1868.      manipulation and trimming functions then you may get unexpected
  1869.      results.
  1870.      Here are the rules:
  1871.      If you read a string to an Easy Base text field all leading and
  1872.      trailing spaces are removed. If the remaining string is longer
  1873.      than the declared field length then it is truncated to the
  1874.      field length.
  1875.      If you read a string to an Easy Base text variable then all
  1876.      trailing spaces are removed. Text Variables are variable
  1877.      length.
  1878.      If you wish to create a string with leading spaces for a write
  1879.      command then you must do it in a text variable. Text fields do
  1880.      not accept leading spaces. You can pad strings with spaces
  1881.      using the Spacepad and Jointext(stringof()) functions.
  1882.      If you read an ASCII line then it is read without the Cr/Lf
  1883.      sequence.
  1884.      You can read ASCII directly into numeric fields.
  1885.      The data in an Easy Base Text Block field is formatted with a
  1886.      single Chr$(13) wherever a new line is to be forced.
  1887.      To read ASCII to a Text Block field, read lines to a variable
  1888.                                  - 43 -
  1889. ................................................................................
  1890.      then join the variable to the field with an intervening
  1891.      CHr$(13).
  1892.      Ex.
  1893.      read line to LineVar
  1894.      Pupils.notes = Jointext(pupils.notes,Chr$(13),Linevar)
  1895.      To Write a Text Block field as ASCII lines use the keyword
  1896.      Line_Len in the write command.
  1897.      Ex.
  1898.      write Pupils.Notes Line_len 60
  1899.      You cannot write quotation marks within quoted text. Whenever
  1900.      Easy Base processes a text field, variable or read in string it
  1901.      substitutes Chr$(127) for internal quotation marks and replaces
  1902.      them after the process. This substitution is not done for
  1903.      direct assignments. TextVar = "Fred said "Hello"" is not
  1904.      allowed. If you need to make such an assignment then you must
  1905.      replace the internal quotation marks with Chr$(127) yourself.
  1906.      To create CHR$(127) in the procedure editor, hold down the ALT
  1907.      key and type 127 on the numeric keypad.
  1908.                                  - 44 -
  1909. ................................................................................
  1910.                     EASY BASE DATA FILE FORMAT
  1911.      Easy Base data files are fixed length record files with no
  1912.      field separator. There is no file header.
  1913.      There is a three byte record header. Byte one is "L" for a live
  1914.      record and "D" for a record marked for deletion. Bytes 2 and 3
  1915.      are null.
  1916.      The field order is top left to bottom right from the default
  1917.      input screen.
  1918.      All text fields are ASCII.
  1919.      All numeric, date and time fields are Microsoft 8 Byte double
  1920.      precision numbers.
  1921.      In the case of dates, this represents the number of days from
  1922.      the first of January 1981 and in the case of time, the number
  1923.      of seconds from midnight.
  1924.                                  - 45 -
  1925. ................................................................................
  1926.                          SYSTEM REQUIREMENTS
  1927.      Required.
  1928.          IBM or compatible 286 or higher
  1929.          1Meg Ram
  1930.          540k free conventional memory   (570k in Network Version)
  1931.      Preferred.
  1932.         4 Meg expanded memory with 2 Meg allocated to PC-Cache
  1933.      NOTE:-
  1934.         If you have 2 Meg of expanded memory then certain EMS
  1935.      managers can cause Easy Base not to load with the error message
  1936.      "Insufficient EMS to load overlays". If this happens to you
  1937.      then you can load Easy Base in conventional memory by remming
  1938.      out the EMS driver in your Config.Sys file.
  1939.                          SYSTEM LIMITATIONS
  1940.      Fields per Form         500
  1941.      Indexes per Form        500
  1942.      Record Length           Limited by display of 4 screen pages
  1943.      Records per Form        Limited by Maximum data or index file
  1944.                              length of 2,100 Megabytes
  1945.      Forms per application       }     Total of 500 in
  1946.      Procedures per application  }     any combination.
  1947.      Menus per application             500
  1948.                                  - 46 -
  1949. ................................................................................
  1950.                        DOS FILENAME CONVENTIONS
  1951.      The Easy Base system files are:-
  1952.         EB.EXE     The program file     (EB.OVL Network)
  1953.         EB.CUR     Initial screen setup
  1954.         EB.SET     Configuration file   (EB.C0, EB.C1 Etc. Network)
  1955.         EB.MEN     User Menus form
  1956.         EB.REL     Relationships form
  1957.         EB.MSG     Text and error messages
  1958.         EB.PRS     Printer drivers
  1959.         EB.D01     Main dictionary
  1960.         EB.DO2     Personal dictionary
  1961.      The files which are created in the data directories have the
  1962.      following filename convention:-
  1963.      Forms:-
  1964.         BASE(No).DEF      The entry screen definition.
  1965.         BASE(No).DAT      The data file.
  1966.         BASE(No).(No)     Index files.
  1967.      Choice field lists
  1968.         LIST(No).DAT
  1969.      Procedures
  1970.         PROC(No).PRO      The procedure code.
  1971.         PROC(No).DEF      The input screen.
  1972.         PROC(No).REP      Procedure output (Pre Network Versions)
  1973.         PROC(No).R(No)    Procedure output (Network versions)
  1974.      There are also six individual files:-
  1975.         MENUS.DAT         The menus you create.
  1976.         RELATION.DAT      The relationships you create.
  1977.         CHOICES.DIR       The choice list directory.
  1978.         BASE.DIR          The forms directory.
  1979.         PROC.DIR          The procedures directory.
  1980.         RECOVER.INF       Recovery information to reinstate a form
  1981.                           should you suffer a power failure during
  1982.                           a pack or reformat operation.
  1983.      From V9 each form and procedure input screen also has a pre
  1984.      processed file: BASE(NO).PPR - PROC(NO).PPR.
  1985.      From Network V1 Private data and index files take the main file
  1986.      name overstamped from the second character by the terminal
  1987.      number. The file name for Terminal 12's private data for
  1988.      BASE6.DAT  is B12E6.DAT
  1989.                                  - 47 -
  1990. ................................................................................
  1991.      Easy Base is a registered trade mark of John Turnbull.
  1992.      Easy Base documentation is copyright John Turnbull 1994. It may
  1993.      be freely distributed as part of the Shareware program and
  1994.      users of Easy Base may print a single copy of the documentation
  1995.      for their own use. All other rights are reserved.
  1996.      Trade marks of any other company included in the documentation
  1997.      are acknowledged.
  1998.      John Turnbull disclaims all warranties as to this software,
  1999.      whether express or implied, including without limitation any
  2000.      implied warranties of merchantability, fitness for a particular
  2001.      purpose, functionality, data integrity or protection.
  2002.                                  - 48 -
  2003. ................................................................................
  2004.       
  2005.                      SELECTED PROGRAMMING TOPICS
  2006.       
  2007.                   Address Labels                50
  2008.                   Automatic Lookups             51
  2009.                   Batch Starting                52
  2010.                   Check Off Fields              53
  2011.                   Compound Index                54
  2012.                   Compound Lookups              57
  2013.                   Conditional Lookups           58
  2014.                   Correcting Stats.             59
  2015.                   Creating Runtime              60
  2016.                   Customize Help Line           61
  2017.                   Cyclic Procedures             62
  2018.                   Data Type Conversion          63
  2019.                   Duplicate Prevention          64
  2020.                   Form Letters                  65
  2021.                   Global Defaults               67
  2022.                   Input Screen Format           68
  2023.                   Invoicing/Ordering            69
  2024.                   Keyword/Text Search           72
  2025.                   Linking Applications          74
  2026.                   Maximizing Speed              75
  2027.                   Multiple Columns              77
  2028.                   Printing System Val.          78
  2029.                   Q And A Input Screen          79
  2030.                   Runtime Auto Start            80
  2031.                   Set System Values             81
  2032.                   Tabulation                    82
  2033.                   Totals & Sub Totals           83
  2034.                                 - 49 -
  2035. ................................................................................
  2036.       ADDRESS LABELS                              
  2037. ADDRESS LABELS
  2038.       If you have a form for names and addresses and you have used
  2039.       separate fields for Name, Company, Street1, Street2, City Etc.
  2040.       and you wish to print address labels from it, you will not wish
  2041.       to leave blank lines in the address label where, for example,
  2042.       there is no Company entry or no Street2 entry.
  2043.       The following procedure compacts each address and transfers it
  2044.       to a text block field for printing :-
  2045.       Declare output fields
  2046.          Left : Right          (Position these as text block fields
  2047.       end                       on the output format .list items)
  2048.       declare variables
  2049.          Compact as text
  2050.          x as number
  2051.       end
  2052.       for addresses
  2053.          If addresses.name <> blank then
  2054.             Compact = jointext(addresses.name,Chr$(13))
  2055.          end if
  2056.          if addresses.company <> blank then
  2057.             compact = jointext(compact,chr$(13),addresses.company)
  2058.          end if
  2059.          compact = jointext(compact,chr$(13),addresses.street1)
  2060.          if addresses.street2 <> blank then
  2061.             compact = jointext(compact,chr$(13),addresses.street2)
  2062.          end if
  2063.          compact = jointext(compact,chr$(13),addresses.city)
  2064.          '.............transfer to left or right
  2065.          x = x + 1
  2066.          if mod(x,2) = 1 then
  2067.             left = compact
  2068.          else
  2069.             right = compact
  2070.             print list items
  2071.             left = blank : right = blank
  2072.          end if
  2073.       next
  2074.       '............print last address if an odd number..
  2075.       if mod(x,2) = 1 then print list items
  2076.                                 - 50 -
  2077. ................................................................................
  2078.       Automatic Lookups                           
  2079. Automatic Lookups
  2080.       Normally, when a user initiates a primary lookup in a text
  2081.       field he will enter a few characters followed by the * in order
  2082.       to narrow down his choice list. If, however, the possible list
  2083.       is fairly small you may wish to have it displayed automatically
  2084.       as if it was the list for a choice field.
  2085.       For example, you have a departments form with a field "name"
  2086.       and there are only twelve records.
  2087.       When entering records to your "Employees" form which has a
  2088.       field for his department, you wish to lookup the department
  2089.       name. If you derive the Department field on this form as
  2090.       "Lookup (Departments,name) and allow user access to it then the
  2091.       user must type at least an * and press return to bring up the
  2092.       list of department names.
  2093.       You can make this list pop up automatically by setting user
  2094.       entry to the department field to "no" and deriving it with the
  2095.       formula:
  2096.       If(Department = Blank,"*",Lookup(Departments,Name))
  2097.       In other words the derivation formula automates the typing of
  2098.       the *.
  2099.       Please note that all forms and input screens must have at least
  2100.       one field to which the user has access. If you wish to make an
  2101.       automatic lookup on a procedure input screen that only has one
  2102.       field then you must add a second field purely to hold the
  2103.       cursor. This can of course be invisible.
  2104.                                 - 51 -
  2105. ................................................................................
  2106.       BATCH STARTING                              
  2107. BATCH STARTING
  2108.       You can by pass any or all of the sign on parameters either by
  2109.       setting them in the environment or by supplying them on the
  2110.       command line.
  2111.       To log on as terminal one in the sub directory accounts using
  2112.       the password "Fred", add the following lines to your
  2113.       autoexec.bat file:-
  2114.       SET EBT=1
  2115.       SET EBD=ACCOUNTS
  2116.       SET EBP=FRED
  2117.       Or start Easy Base with the command line :-
  2118.       EB T=1 D=ACCOUNTS P=FRED
  2119.       The terminal number parameter applies to network versions only.
  2120.       Any parameters which are not supplied either in the environment
  2121.       or on the command line will be asked for on start up.
  2122.       If you have set the start up parameters in the environment and
  2123.       you start Easy Base with different parameters on the command
  2124.       line, The parameters on the command line override those in the
  2125.       environment.
  2126.       If your application has different passwords for different menu
  2127.       structures you can set the terminal number and directory and
  2128.       leave the user to supply the password.
  2129.       If the user has access to different directories then just set
  2130.       the terminal number and the user can choose the directory and
  2131.       enter the password.
  2132.       See also Runtime Autostart
  2133.                                 - 52 -
  2134. ................................................................................
  2135.       Check off fields                            
  2136. Check off fields
  2137.       Occasionally you may wish to have a field which is simply used
  2138.       to mark or "Check off" items to be done or printed. There is no
  2139.       graphical output from Easy Base but you can create a reasonable
  2140.       check off field by making it a choice field and using the two
  2141.       choices ASCII 255 and ASCII 251.
  2142.       You must use ASCII 255 as the blank as a "Blank" choice is
  2143.       deleted at run time and ASCII 251 (
  2144. ) which is actually the
  2145.       square root sign makes a reasonable "Tick".
  2146.       To enter the characters, hold down the Alt key and type the
  2147.       number on the numeric key pad.
  2148.       To have a form or input screen display with the items ready
  2149.       ticked, just define the tick fields with this choice list,
  2150.       derive them as Default(
  2151. ) and make the color Text, Alt1 or
  2152.       Alt2. Easy Base will automatically display the help line "Press
  2153.       the space bar to change".
  2154.                                 - 53 -
  2155. ................................................................................
  2156.       COMPOUND INDEX                              
  2157. COMPOUND INDEX
  2158.       If you need to list records from a form in such a way that they
  2159.       are grouped by one field but with each record in the group
  2160.       ordered by another then you can either use a compound index
  2161.       field or "Subindex" the group during the procedure.
  2162.       A compound index field is simply an additional field in which
  2163.       the contents of two or more fields are compounded using the
  2164.       "Jointext" function. The field is indexed and the index on that
  2165.       field can then be used to select records with the desired group
  2166.       ordering.
  2167.       For example:- A "Videos" form has fields for "Title",
  2168.       "RentalPrice" and "Category".
  2169.       To list the records grouped by "Category" but with the "Titles"
  2170.       in each category in alphabetic order you add another field to
  2171.       the form which is Text, Indexed and long enough to hold the
  2172.       contents of both the "category" and "Title" fields. The field
  2173.       is derived by joining the text of the "Category" and "Title"
  2174.       fields.
  2175.       There are a couple of minor complications in creating compound
  2176.       index fields. Firstly the "Jointext" function by default strips
  2177.       any trailing space characters from the text it is joining. If a
  2178.       straight "Jointext" function was used and the first two videos
  2179.       entered were "A Bridge Too Far" and "Snow White" then the
  2180.       compound fields would derive as:-
  2181.       "WarA Bridge Too Far"  and
  2182.       "CartoonSnow White"
  2183.       When what you need is:-
  2184.       "War      A Bridge Too Far"  and
  2185.       "Cartoon  Snow White      "
  2186.       To produce the desired spacing in the compound field use the
  2187.       "Spacepad" function.
  2188.       If the length of the "Category" field is 15 then derive the
  2189.       compound field with - Jointext(spacepad(category,15),title)
  2190.       If you are compounding more than two fields then "spacepad" all
  2191.       the fields being joined to their own field's length except the
  2192.       last one.
  2193.       The maximum length of a text field in Easy Base is 80
  2194.       characters. If the fields you need to compound total more than
  2195.       80 then you must reduce the length of the field names. Compound
  2196.       indices in Text Block fields should not be used.
  2197.                                 - 54 -
  2198. ................................................................................
  2199.       COMPOUND INDEX                              
  2200. COMPOUND INDEX
  2201.       Once you have created a compound field and checked that it
  2202.       derives correctly it is normal to define it as invisible and no
  2203.       entry anyway as it is not its contents that are of interest but
  2204.       the order which its index produces.
  2205.       Ex.   Assuming the compound field was called "catgroup"
  2206.       ..........................code..................
  2207.       for videos with catgroup in order
  2208.          print list items
  2209.       next
  2210.       ........................format.................
  2211.       .List Items
  2212.             {Videos.Category Field}     {Videos.Title Field}
  2213.       .End
  2214.       Ex.
  2215.       ...........................code....................
  2216.       declare variables
  2217.          catcheck as text
  2218.       end
  2219.       for videos with catgroup in order
  2220.          if catcheck <> videos,category then print group header
  2221.          catcheck = videos.category
  2222.          print list items
  2223.       next
  2224.       ..........................format...............
  2225.       .Group Header
  2226.          -------------------------------------
  2227.          Films categorized as {category field}
  2228.          -------------------------------------
  2229.       .List Items
  2230.                     {Title field}
  2231.       .End
  2232.       There is yet a further complication if one or more of the
  2233.       fields to be compounded is numeric. Easy Base index files are
  2234.       sorted alphabetically if the field is text and numerically if
  2235.       the field is numeric. A compound field is always text so if you
  2236.       need to compound a numeric field you have to ensure that it
  2237.       will sort alphabetically to the same order that it sorts
  2238.       numerically. The text of numeric values sort alphabetically to
  2239.       the same order as their values only if they all have the same
  2240.       number of digits either side of the decimal point.
  2241.       6  12 and 34 sort alphabetically as 12  34  6
  2242.       but
  2243.       06 12 and 34 sort alphabetically as 06  12  34
  2244.                                 - 55 -
  2245. ................................................................................
  2246.       COMPOUND INDEX                              
  2247. COMPOUND INDEX
  2248.       Easy Base provides the function "Zeropad" to pad numbers to the
  2249.       same length for compounding.  The "Zeropad" function has three
  2250.       parameters - The number to be padded, the number of digits left
  2251.       of the decimal to pad to and the number of digits right of the
  2252.       decimal to pad to. All three parameters must be supplied. If
  2253.       the number is an integer then the third parameter is 0.
  2254.       Ex. To list the "Videos" records grouped by rental price with
  2255.       the titles in each price group in order you would create a
  2256.       compound field derived with:-
  2257.       Jointext(zeropad(rentalprice,2,2),title)
  2258.       Ex.
  2259.       A "Ships" form has fields for "Type" and "Displacement"
  2260.       To list the ships grouped by type with the Displacement in each
  2261.       group in order you would create a compound field derived with:-
  2262.       jointext(spacepad(type,15),zeropad(displacement,8,0))
  2263.       In many cases where you wish to compound a mixture of text and
  2264.       numeric fields you will require the numeric values to be listed
  2265.       in descending order while the text value is to be in alphabetic
  2266.       order.
  2267.       In the above example for ships, had you wished each group to
  2268.       be listed with "Displacement" in descending order you would
  2269.       derive the compound field as:-
  2270.       jointext(spacepad(type,15),reverse(zeropad(displacement,8,0)))
  2271.       The "Reverse" function simply inverts the ACSII number of each
  2272.       character in its parameter so that it will sort in reverse
  2273.       order in the index file.
  2274.       The "Reverse" function works equally well on text values
  2275.       although reverse alphabetic lists are seldom required.
  2276.       The "Zeropad" function will only pad out a number to the size
  2277.       required. It will not trim the number if it is already longer
  2278.       than one of the pad lengths. You should not therefore create
  2279.       compound fields with Floating Point numbers.
  2280.       If you compound a date or time field you should zeropad it to
  2281.       5,0 as the text which will be used is actually the date or time
  2282.       fields numeric value.
  2283.                                 - 56 -
  2284. ................................................................................
  2285.       COMPOUND LOOKUPS                            
  2286. COMPOUND LOOKUPS
  2287.       Occasionally, in an input screen, you will wish to lookup
  2288.       details from a form whose unique field is a compound of two
  2289.       others.  As an example, if you wished to lookup details from
  2290.       the "Userlist" form, mentioned in the manual, then you would
  2291.       have to base the lookups on a relationship between a field on
  2292.       the input screen and the "UNI" field in "Userlist". The "UNI"
  2293.       field in userlist is a combination of the "Aircraft" forms
  2294.       "Knownas" field and the "Airlines" form "Name" field.
  2295.       Although you could simply use a field "UNI" on the input screen
  2296.       and derive it :- Lookup(userlist,uni) - this would mean that
  2297.       the end user would have to enter the whole of the aircraft
  2298.       Knownas part plus part of the airlines name part plus the "*"
  2299.       in order to get the lookup.
  2300.       This would not only be awkward to use but would also entail
  2301.       explaining compound fields to the end user.
  2302.       You can avoid this situation by providing two fields, one in
  2303.       which the user looks up the aircraft knownas field and one in
  2304.       which he looks up the airline name. These are based on separate
  2305.       relationships between the input screen and the "Aircraft" and
  2306.       "Airlines" forms.
  2307.       The input screen's "UNI" field can now be made invisible with
  2308.       no user entry and derived:- Jointext(knownas,name).
  2309.       A relationship is entered between the input screen and the
  2310.       "Userlist" form linking the "UNI" fields and all the required
  2311.       details can then be derived :- lookup(userlist,whatever).
  2312.                                 - 57 -
  2313. ................................................................................
  2314.       Conditional Lookups                         
  2315. Conditional Lookups
  2316.       Occasionally you may wish to use a single field either to
  2317.       initiate a lookup or to accept direct input from the keyboard.
  2318.       For example on an input screen to a procedure that enters
  2319.       invoice lineitems there is a field Partname which is related to
  2320.       the Name field in the "Parts" form. The entry to this field
  2321.       initiates a primary lookup for its own value and a secondary
  2322.       for the Price field. The user enters the first few characters
  2323.       of the part name followed by an *, then chooses the part name
  2324.       from the lookup list. If you also wish the user to be able to
  2325.       enter a partname that is not in the parts form then derive the
  2326.       partname field:-
  2327.       If(Intext(Partname,"*") > 0,Lookup(Parts,Name),Partname)
  2328.       If the user enters an * anywhere in the field then a lookup
  2329.       will be done from the parts form, but if he does not enter an *
  2330.       then the field will retain whatever name he entered.
  2331.       If you wish to be able to tell whether or not a lookup has been
  2332.       made for use in the procedure code - perhaps to add the new
  2333.       part to the parts form - then use a special character other
  2334.       than the * as the condition.
  2335.       For example, if you derive Partname as:-
  2336.       If(Lefttext(Partname,1) = "+",Partname,Lookup(Parts,Name))
  2337.       then any entry to the field which starts with the "+" character
  2338.       will not initiate the lookup. You can then use the fact that
  2339.       the partname starts with a + to enter a new record in the parts
  2340.       form.
  2341.       Declare variables
  2342.          NN as text
  2343.       end
  2344.       NN = Input.partname
  2345.       If Lefttext(NN,1) = "+" then
  2346.          NN = righttext(NN,Lengthtext(NN)-1)
  2347.          For parts new record
  2348.             Parts.name = NN
  2349.          Next
  2350.       End if
  2351.       for Invoicelines
  2352.          copy all from input
  2353.          Partname = NN
  2354.       next
  2355.                                 - 58 -
  2356. ................................................................................
  2357.       CORRECTING STATS.                           
  2358. CORRECTING STATS.
  2359.       If you write an application in which records are entered via
  2360.       procedures and "running" statistics are kept, you will have to
  2361.       provide procedures which allow the user to correct any mistakes
  2362.       he has made.
  2363.       For Example: - In a "Time Sheets" application the user enters a
  2364.       time and customer on the input screen of a procedure. The
  2365.       procedure then calculates the charge, writes the charge and
  2366.       customers name to the "Timesheet" form, adds the charge to the
  2367.       "Balance" field in the "Customers" form and also adds it to the
  2368.       "Total" field in the "Workinhand" form.
  2369.       If the operator makes an error then correcting the entry in the
  2370.       "Timesheet" form is simply a case of updating it but to correct
  2371.       the "Balance" and "Total" fields you must add the corrected
  2372.       value and subtract the old incorrect value.
  2373.       To get the two values together for your procedure, create an
  2374.       input screen where the operator enters the "line" ("line" is
  2375.       the unique sequenced field in "Timesheet").  Then create two
  2376.       fields for the values. The first, "oldval" is derived
  2377.       lookup(timesheet,charge) and the second, "newval" is derived
  2378.       default(lookup(timesheet,charge).
  2379.       The "Oldval" field can be invisible and has no user entry.
  2380.       You would also add two similarly derived fields "Oldcustomer"
  2381.       and "Newcustomer".
  2382.       When the user edits the "Newval" and/or "Newcustomer" field and
  2383.       presses F2 , all the required values are available to the
  2384.       procedure code:-
  2385.       pause off : escape off
  2386.       for timesheet with line = input.line
  2387.          timesheet.charge = input.newval
  2388.          timesheet.customer = input.newcustomer
  2389.          update record
  2390.       next
  2391.       for customers with name = input.oldcustomer
  2392.          customers.balance = customers.balance - input.oldval
  2393.          update record
  2394.       next
  2395.       for customers with name = input.newcustomer
  2396.          customers.balance = customers.balance + input.newval
  2397.          update record
  2398.       next
  2399.       for workinhand
  2400.         workinhand.total = workinhand.total+input.newval-input.oldval
  2401.         update record
  2402.       next
  2403.                                 - 59 -
  2404. ................................................................................
  2405.       CREATING RUNTIME                            
  2406. CREATING RUNTIME
  2407.       To create a distributable application with the Easy Base
  2408.       Royalty free Runtime Module, first, ensure that your
  2409.       application has a user menu with a start up password. If you
  2410.       wish your runtime application to start without a sign on screen
  2411.       then this password should be "Autostart".
  2412.       Make a new directory for your module and copy all the files
  2413.       from the Easy Base sub directory in which you developed the
  2414.       application to it.
  2415.       Copy the Configuration file "EB.SET" from your Easy Base
  2416.       directory to this directory.
  2417.       Insert the Runtime Module disk in a floppy drive. Change to
  2418.       that drive and type "MODULE".
  2419.       The "Module" program will first ask you for the path to the
  2420.       application files. Once you enter this it will unpack the
  2421.       runtime files into your new directory.
  2422.       It will then ask for the name of your application. The name you
  2423.       supply here will be displayed on any sign on screens and also
  2424.       on the shutdown "Thank you for using - " line.
  2425.       It will then ask you for your copyright line. The text you
  2426.       enter here will replace the line "Application of Easy Base -
  2427.       Not for Resale" which appears above your menus.
  2428.       Finally, you will be asked for the Executable file name you
  2429.       wish to use for your program.
  2430.       When you have entered the details - Press F2 and your
  2431.       application will be complete and ready to sell.
  2432.                       --------------------------
  2433.       EASY INSTALL UTILITY
  2434.       For professional distribution disks just like the ones Easy
  2435.       Software is distributed on, you can purchase Easy Install.
  2436.       This utility will compress your application and create a
  2437.       distribution disk with an install program customized for your
  2438.       application.
  2439.                                 - 60 -
  2440. ................................................................................
  2441.       CUSTOMIZE HELP LINE                         
  2442. CUSTOMIZE HELP LINE
  2443.       You can replace the default help line (bottom line) in both
  2444.       data entry and procedure input screens.
  2445.       Press F6 in form or input screen design to access the help
  2446.       line.
  2447.       If you wish to revert to the default help line just erase your
  2448.       customized one.
  2449.       The line which you enter here becomes the default but is
  2450.       overridden when the cursor is in any field with a Help prefix.
  2451.                                 - 61 -
  2452. ................................................................................
  2453.       CYCLIC PROCEDURES                           
  2454. CYCLIC PROCEDURES
  2455.       In many applications you will come across the situation where
  2456.       you need a procedure which will perform the same actions on a
  2457.       given set of records. For example, in a payroll system the
  2458.       procedure which calculates the employees wage and deductions
  2459.       has to be repeated for each employee so that their hours can be
  2460.       entered. If you simply enter each employees Worksno and lookup
  2461.       his or her details then it will be easy to miss an employee or
  2462.       to do one twice.
  2463.       To avoid this you can create a procedure which will cycle each
  2464.       employee through the input screen and terminate when all
  2465.       employees have been processed.
  2466.       On the employees form, add a field "Cycled" which is a single
  2467.       character indexed field derived :- Default("N").
  2468.       On the procedure input screen add an invisible field "Cycled"
  2469.       which is derived "N"
  2470.       You now enter two relationships between the procedure and the
  2471.       employees form. The main relationship "Employees" links the
  2472.       fields "Worksno" and the second, lets call it "Cycled" links
  2473.       the "Cycled" fields.
  2474.       On the input screen you derive the "Worksno" field as
  2475.       Lookup(cycled,worksno) and all the other details as
  2476.       lookup(employees,Whatever).
  2477.       When you run the procedure, the first employees details will be
  2478.       loaded automatically and all you have to enter are his hours.
  2479.       To have the next employee loaded after you run the procedure,
  2480.       the procedure code simply includes the lines:-
  2481.       for employees with worksno = input.worksno
  2482.          employees.cycled = "Y"
  2483.          update record
  2484.       next
  2485.       When all employees have been processed the "Worksno" field will
  2486.       derive blank as there are no employees with "N" in the "Cycled"
  2487.       field. You can therefore pass a "finished" message by altering
  2488.       the derivation of "Worksno" to :-
  2489.         if(lookup(cycled,worksno)=blank,blank[beepAll Employees have
  2490.         now been processed],lookup(cycled,worksno))
  2491.       To reset cycling for the next payroll you write an additional
  2492.       procedure with the code:-
  2493.       for employees
  2494.          employees.cycled = "N" : update record
  2495.       next
  2496.                                 - 62 -
  2497. ................................................................................
  2498.       Data Type Conversion                        Data Type Conversion
  2499.       In Easy Base, modifying the structure of a data file after it
  2500.       contains data is very easy and flexible. If you select Modify
  2501.       Existing Form from the Forms menu you can add fields, delete
  2502.       fields, change field order, change field lengths and Easy Base
  2503.       will reformat your existing data automatically.
  2504.       You can NOT however change data types simply by changing the
  2505.       field type. If you change a field type and save the form you
  2506.       will almost certainly lose the data that was in that field.
  2507.       (Other than changing from one numeric type to another)
  2508.       If you work entirely within Easy Base there is no reason why
  2509.       you should ever need to change a field type. However, if you
  2510.       have imported data from Dbase or Fixed Length ASCII you may
  2511.       find yourself with numeric or date values held in text fields.
  2512.       The procedure for converting data from one type to another is
  2513.       as follows:-
  2514.       1.   Select Modify Existing Form
  2515.       2.   Add a new field of the desired type with a derivation
  2516.            formula such that it will derive its value from the field
  2517.            of the old type.
  2518.       3.   Save the form.
  2519.       4.   Select Modify the form again.
  2520.       5.   Cancel the derivation formula in the new field and delete
  2521.            the old field.
  2522.       6.   Re save the form.
  2523.       To derive a numeric field from a text field the derivation
  2524.       formula is simply the text field name.
  2525.       To derive a date field from a Dbase imported date in a text
  2526.       field called DT the formula is:-
  2527.       Makedate(midtext(DT,5,2),midtext(DT,7,2),midtext(DT,3,2))
  2528.       Version 3.10
  2529.       From V3.1 you can change field types between text and numeric
  2530.       and retain any numeric values that were in the field
  2531.       automatically . You still cannot change a field type from date
  2532.       or time to text or vice versa without following the above
  2533.       procedure.
  2534.                                 - 63 -
  2535. ................................................................................
  2536.       DUPLICATE PREVENTION                        DUPLICATE PREVENTION
  2537.       1.  Where "Blank" values are acceptable.
  2538.       Quite often you will come across a situation where a field must
  2539.       not have duplicate entries but can still be left blank. You
  2540.       cannot define this field as unique because that would prevent
  2541.       more than one blank entry.  A good example of such a situation
  2542.       is in the "Menus Form" of Easy Base. The definition and unique
  2543.       field is the "Menu Title" but no two records may have the same
  2544.       entry in the sign on "Password" field.
  2545.       To prevent duplicate entries other than blanks you must enter a
  2546.       relationship between the form and itself with the field to be
  2547.       tested as the related field in both primary and secondary
  2548.       forms.
  2549.       The field is then derived as :-
  2550.       If(lookup(menus,password) <> blank,blank[beepDuplicate Password
  2551.                !],password)
  2552.       2.   When entering records via procedures.
  2553.       When you use a procedure to enter a new record to a form it is
  2554.       not automatically checked as "Unique".   To ensure that
  2555.       duplicate entries are not entered via procedures you must check
  2556.       that the data entered on the procedures input screen is unique
  2557.       to the form you are about to enter it to before running the
  2558.       procedure.  For example: If you were about to enter a record to
  2559.       the "Manufacturers" form in which the "Name" field was unique
  2560.       then the "Name" field on the input screen would be derived:-
  2561.          if(lookup(manufacturers,name) <> blank,blank[beepDuplicate
  2562.                     Name !cursor name],name)
  2563.                                 - 64 -
  2564. ................................................................................
  2565.       FORM LETTERS                                
  2566. FORM LETTERS
  2567.       To print form letters (circulars) with a different address and
  2568.       salutation for each entry in an address form simply type the
  2569.       entire letter between the .List Items and .End of the output
  2570.       format.
  2571.       .........................procedure code........
  2572.       Declare output fields
  2573.          Addr.name : Addr.street : Addr.town
  2574.          Addr.salutation
  2575.          date
  2576.       end
  2577.       date = datetext(system date)
  2578.       for addr
  2579.          print list items
  2580.          page feed
  2581.       next
  2582.       .........................output format........
  2583.       .List Items
  2584.                                              My street
  2585.                                              My county
  2586.                                              {date field  }
  2587.       {Addr.name field    }
  2588.       {Addr.street field  }
  2589.       {Addr.town field    }
  2590.       Dear {Addr.salutation},
  2591.           You are invited................................
  2592.       ...................................................
  2593.       ...................................................
  2594.       ..........................................
  2595.       Yours faithfully,
  2596.       Fred A Blogs
  2597.       .End
  2598.       Although this is the fastest way to produce a short form
  2599.       letter, the Format Editor is not the nicest place to write
  2600.       text. If you want the benefits of word wrap and spell checking
  2601.       then you can create a form in which to write the letter. Create
  2602.       text block fields to hold a page of text and a name field so
  2603.       that you can store many different letters and print them with
  2604.       the same procedure. If your letters are to be more than one
  2605.       page long then put the same name on each page.
  2606.                                 - 65 -
  2607. ................................................................................
  2608.       FORM LETTERS                                
  2609. FORM LETTERS
  2610.       To print the form letters from the "Letters" form your
  2611.       procedure must now have an input screen which looks up the name
  2612.       of the letter to be printed.
  2613.       '............................CODE.....................
  2614.       declare output fields
  2615.          addr.name : addr.street : addr.town :addr.salutation
  2616.          date :letters.block1 :letters.block2 :letters.block3
  2617.       end
  2618.       declare variables
  2619.          page as number
  2620.       end
  2621.       date = datetext(system date)
  2622.       for addr
  2623.          page = 0
  2624.          for letters with name = input.name
  2625.             page = page + 1
  2626.             if page = 1 then print list items
  2627.             if page > 1 then print extra
  2628.             page feed
  2629.          next
  2630.       next
  2631.       The output format is similar to that shown on the previous page
  2632.       but the text in the .list items section is replaced by the text
  2633.       block fields Letters.block1 ,letters.block2 and letters.block3
  2634.       and an additional section .extra is added which has the same
  2635.       text block fields but no address or salutation.
  2636.                                 - 66 -
  2637. ................................................................................
  2638.       GLOBAL DEFAULTS                             
  2639. GLOBAL DEFAULTS
  2640.       In many instances, an application will use the same default
  2641.       values in many procedures and field derivations. If you
  2642.       "hardwire" these as constants into your procedures and code
  2643.       then they will all have to be changed when the default value
  2644.       changes.
  2645.       Easy Base is supplied with a single global defaults form for
  2646.       VAT rates but you can create your own for any particular
  2647.       application.
  2648.       For instance, should you write a payroll system you would wish
  2649.       to be able to update the tax rates and bands globally
  2650.       throughout your application when they change.
  2651.       To do this, create a form to hold all the global defaults. In
  2652.       addition to the default fields add a single character text
  2653.       field derived "X" and index it. You then enter a single record
  2654.       with all the default values. The "X" field is there to create
  2655.       an artificial relationship between any input screen and the
  2656.       defaults form in order to lookup defaults.
  2657.       Wherever you need one or more global defaults in an input
  2658.       screen you simply add an invisible "x" field and enter a
  2659.       relationship between the procedure and the defaults form
  2660.       linking the "x" fields.
  2661.       The field "Tax" can now be derived:-
  2662.          taxablepay * lookup(defaults,taxrate)
  2663.       Similarly, you can pre load variables in procedure code for the
  2664.       default values:-
  2665.       Declare variables
  2666.         Taxrate1 as number:Taxrate2 as number
  2667.         Taxband1 as number:Taxband2 as number
  2668.       end
  2669.       for defaults
  2670.         Taxrate1 = defaults.taxrate1 :Taxrate2 = defaults.taxrate2
  2671.         Taxband1 = defaults.taxband1 :Taxband2 = defaults.taxband2
  2672.       next
  2673.       When the taxrates change you only have to alter them once in
  2674.       the Defaults form.
  2675.                                 - 67 -
  2676. ................................................................................
  2677.       Input Screen Format                         
  2678. Input Screen Format
  2679.       All form and input screens can be presented either mounted in a
  2680.       window against a mottled background or exactly as drawn in form
  2681.       design. The windowing effect is done automatically if you leave
  2682.       a clear border around all text and fields. If you place fields
  2683.       or text anywhere against the edge of the screen (even invisible
  2684.       fields) then the window effect will not be invoked.
  2685.       If you do not want the window effect but you still wish to
  2686.       leave a clear border then you should place the invisible text
  2687.       character (ASCII 255) in the top left hand corner of the
  2688.       screen to disable it. To produce the invisible character hold
  2689.       down the Alt Key and type 255 on the numeric keypad.
  2690.                                 - 68 -
  2691. ................................................................................
  2692.       Invoicing/Ordering                          
  2693. Invoicing/Ordering
  2694.       To create a simple order processing or invoicing system you
  2695.       need forms for :
  2696.          Stock     (ID#,descrip,price,qtyonhand etc)
  2697.          Customers (ID#,name,address etc)
  2698.          Lineitems (Customer ID,Item ID,Qty,price)
  2699.          Last      (Single record with Last invoice/order number)
  2700.          Current   (Single record for current Cust ID/Invoice No)
  2701.       Both of the forms "Last" and "Current" also have a field called
  2702.       "X" which is a single character indexed text field containing
  2703.       the character "x"
  2704.       You also need three procedures:
  2705.          SelectCustomer
  2706.          EnterItems
  2707.          PrintInvoice
  2708.       The first procedure has an input screen on which you verify the
  2709.       Customers ID# for the invoice. Whether you do this by entering
  2710.       the ID# and looking up the name and address to verify it or by
  2711.       using a primary lookup on the customers name is up to you.
  2712.       The input screen also has an invisible single character text
  2713.       field which is derived "X" and an InvoiceNo field. As well as
  2714.       the relationship to lookup the customers name, the input screen
  2715.       is also related to the Last form linking the "X" fields.
  2716.       The InvoiceNo field is derived Lookup(Last,InvoiceNo) + 1
  2717.       When you have looked up the Customer you run this procedure
  2718.       which has the code:
  2719.       ...................................................
  2720.       For Last
  2721.          Last.Invoiceno = Input.Invoiceno : Update Record
  2722.       Next
  2723.       For Current
  2724.          Current.Invoiceno = Input.Invoiceno
  2725.          Current.CustomerID = Input.CustomerID
  2726.          Update Record
  2727.       Next
  2728.       Run EnterItems
  2729.       ..............................................
  2730.       The second procedure "Enteritems" now takes over and it has an
  2731.       input screen where you lookup items from your stock form
  2732.       together with their price, and enter the quantity. This
  2733.       procedure has a repeating input screen. It is used to enter one
  2734.       line at a time into the LineItems form. You must also nominate
  2735.       a function key which will be used to run the PrintInvoice
  2736.       procedure when all invoice items have been entered. A suitable
  2737.       default help line might be:-
  2738.                                 - 69 -
  2739. ................................................................................
  2740.       Invoicing/Ordering                          
  2741. Invoicing/Ordering
  2742.       "F2=Enter Invoice Item   F4=Print Invoice  F10=Cancel"
  2743.       It is important that the user should not terminate this
  2744.       procedure with the escape key so you should disable it and the
  2745.       other function keys in one of your field derivations:
  2746.       Disable "Esc5789"
  2747.       Like the SelectCustomer procedure this screen also has an
  2748.       invisible "x" field - no entry and derived "X". This time it is
  2749.       related to the X field in the Current form. There are fields
  2750.       for InvoiceNo and CustomerID. Both are no entry and are
  2751.       derived: Lookup(Current,InvoiceNo)  Lookup(Current,CustomerID)
  2752.       The main relationship of course is to the Stock form to lookup
  2753.       the stock item and price. Again, like the first procedure, it
  2754.       is up to you whether you enter stock ID#s and lookup the
  2755.       description and price or do a primary lookup on the Stock
  2756.       Descrip field. This procedure writes a new record to the
  2757.       LineItems form if F2 is pressed, runs Printinvoice if F4 is
  2758.       pressed and "Tidies Up" if F10 is pressed.
  2759.       ................................................
  2760.       If Fun_Key = 4 then run Printinvoice
  2761.       If Fun_Key = 10 then
  2762.          for LineItems with InvoiceNo = Input.InvoiceNo
  2763.             Delete Record
  2764.          Next
  2765.          For Last
  2766.             Last.Invoiceno = Last.Invoiceno - 1 : Update record
  2767.          Next
  2768.          Run SelectCustomer
  2769.       End if
  2770.       For LineItems new record
  2771.          Copy all from Input
  2772.       Next
  2773.       ..............................................
  2774.       The third procedure "PrintInvoice" is run when the user presses
  2775.       F4 and has the Following code.
  2776.       Declare output fields
  2777.          Customers.Name : Customers.Address
  2778.          LineItems.StockID : LineItems.Descrip : LineItems.Qty
  2779.          LineItems.Price
  2780.          LineTotal : SubTotal : Tax : GrandTotal
  2781.          InvoiceNo : CustomerID
  2782.       End
  2783.       '............Get Nos from Current
  2784.       For Current
  2785.          InvoiceNo = Current.Invoiceno
  2786.          CustomerID = Current.CustomerID
  2787.       Next
  2788.                                 - 70 -
  2789. ................................................................................
  2790.       Invoicing/Ordering                          
  2791. Invoicing/Ordering
  2792.       '.......Print Customer details to invoice header
  2793.       For Customers with ID = CustomerID
  2794.          Print Report Header
  2795.       Next
  2796.       '.................Print Invoice Lines...
  2797.       For LineItems with InvoiceNo = InvoiceNo
  2798.          LineTotal = LineItems.Price * LineItems.Qty
  2799.          SubTotal = Subtotal + LineTotal
  2800.          Print List Items
  2801.          '........Update Stock on hand
  2802.          For stock with ID = LineItemsID
  2803.             Stock.Qtyonhand = Stock.Qtyonhand - LineItems.Qty
  2804.             Update Record
  2805.          Next
  2806.       Next
  2807.       ,..................Report Footer
  2808.       Tax = VATon(SubTotal)
  2809.       GrandTotal = Subtotal + Tax
  2810.       Print Report Footer
  2811.       Page Feed
  2812.       Notice that the Quantity on hand field in the stock form is not
  2813.       updated until you actually print the invoice. You could have
  2814.       done it while you were entering the Line Items but it would
  2815.       make the tidying process more complicated if the invoice were
  2816.       cancelled with F10 after items had been written.
  2817.                                 - 71 -
  2818. ................................................................................
  2819.       Keyword/Text Search                         
  2820. Keyword/Text Search
  2821.       If you have a database with a large number of items where the
  2822.       user would be unlikely to know exactly what he is looking for
  2823.       you will need to provide a search facility based on text
  2824.       supplied by the user. There are two main ways to do this and
  2825.       both have advantages in different situations.
  2826.       Suppose you have a form for technical publications. There are
  2827.       fields for Name, Publisher, Price, Short Description Etc. A
  2828.       user wishing to search this form will not know the contents of
  2829.       any of the fields - he will only know the topic or subject
  2830.       which he wants to look up.
  2831.       You need to get some search text from the user, find the names
  2832.       of any publications which may cover the subject then make a
  2833.       short list of them in the PickList form.
  2834.       The simplest way is to have an input screen field where the
  2835.       user can enter search text, then search the "ShortDescrip"
  2836.       field for the occurrence of the text he has entered. Wherever
  2837.       his text is found you add a new record to the PickList form.
  2838.       The user can then mark the titles which interest him and you
  2839.       can print out the short descriptions of the publications he has
  2840.       chosen.
  2841.       Clear records from PickList
  2842.       for Publications
  2843.          If intext(shortdescrip,input.searchtext) > 0 then
  2844.             for PickList new record
  2845.                PickList.Item = Publications.Name
  2846.             next
  2847.          end if
  2848.       next
  2849.       Show Picklist
  2850.       For PickList with Mark = Chr$(251)
  2851.          For Publications with Name = Picklist.Item
  2852.             Print List Items
  2853.          next
  2854.       next
  2855.       The advantage of this method is that the user is free to enter
  2856.       any text and will get a "Hit" if it exists anywhere in the
  2857.       description. The disadvantage is that every record in the
  2858.       publications form has to be searched. This form of searching
  2859.       becomes too time consuming if there are many thousands of
  2860.       records. You can overcome the time problem in a large database
  2861.       by adding a KeyWord form.
  2862.       A KeyWord form has two fields, one for the publication name and
  2863.       one for a key word. Each publication can have several entries
  2864.       in this form with different key words. The Keyword field is
  2865.       indexed so if you now search this form for the entered text you
  2866.       will get a list of publications with the entered keyword very
  2867.                                 - 72 -
  2868. ................................................................................
  2869.       Keyword/Text Search                         
  2870. Keyword/Text Search
  2871.       quickly. The disadvantage of this method is that the user will
  2872.       only get a "Hit" if he enters a word that you have chosen as a
  2873.       KeyWord.
  2874.       You can optimize this method by choosing Keywords that might
  2875.       contain text the user might enter within them. Eg use the
  2876.       keyword "Installation" rather than "Install" and make your
  2877.       routine select with >= rather than =
  2878.       Declare variables
  2879.         Len as number
  2880.       end
  2881.       Len = lengthtext(input.searchtext)
  2882.       For Keywords with Key >= input.searchtext
  2883.          if lefttext(keywords.Key,Len) <> input.searchtext then
  2884.             exit for
  2885.          end if
  2886.          for PickList new Record
  2887.             Picklist.Item = Keywords.Publication
  2888.          next
  2889.       Next
  2890.       Show Picklist
  2891.       For PickList with Mark = Chr$(251)
  2892.          For Publications with Name = PickList.Item
  2893.             Print List Items
  2894.          Next
  2895.       Next
  2896.       Entering Keyword records can be incorporated into the procedure
  2897.       which writes the Publications record to save time when entering
  2898.       data.
  2899.       For Publications new record
  2900.          Copy all from input
  2901.       Next
  2902.       for Keywords new record
  2903.          Keywords.Publication = Input.Name
  2904.          Keywords.Key = Input.Keyword1
  2905.       next
  2906.       If Input.Keyword2 <> blank then
  2907.          For Keywords new record
  2908.             Keywords.Publication = Input.Name
  2909.             Keywords.Key = Input.Keyword2
  2910.          Next
  2911.       End if
  2912.       Repeat last section for the number of keywords on the input
  2913.       screen.
  2914.                                 - 73 -
  2915. ................................................................................
  2916.       LINKING APPLICATIONS                        LINKING APPLICATIONS
  2917.       Procedures in one directory can access forms in another
  2918.       directory or disk by placing the external forms path in
  2919.       brackets immediately after the form name at the start of a For
  2920.       Loop.
  2921.       Ex.
  2922.       For payroll (c:\pay) with posted = "No"
  2923.          for purchaseledger new record
  2924.             copy all from payroll
  2925.          next
  2926.          payroll.posted = "Yes"
  2927.          update record
  2928.       next
  2929.       The above procedure, in an accounts application, imports data
  2930.       from a payroll application in C:\PAY and updates the "Posted"
  2931.       field in the payroll application.
  2932.       Ex.
  2933.       for sales (A:\) alias import
  2934.          for sales new record
  2935.            copy all from import
  2936.          next
  2937.       next
  2938.       The above procedure is used to import data transferred from one
  2939.       machine to another on floppy disk.
  2940.       Note:-
  2941.       1.   If transferring data on floppy disk the floppy must hold
  2942.       the forms .DAT and .DEF files together with the BASE.DIR from
  2943.       the source application. If you need to move large amounts of
  2944.       data on floppy it is much quicker to simply overwrite an import
  2945.       forms .DAT file and then pack it to rewrite the indices.
  2946.                                 - 74 -
  2947. ................................................................................
  2948.       MAXIMIZING SPEED                            
  2949. MAXIMIZING SPEED
  2950.       Because the procedures you create in Easy Base have to be
  2951.       interpreted each time they are run they will tend to be slower
  2952.       than similar routines created in a compiled system. This is the
  2953.       unavoidable cost of ease of use. You can increase speed vastly
  2954.       by having the best DOS environment and by the way in which you
  2955.       write procedure code.
  2956.       DOS Environment.
  2957.       1.   Do not use a disk compression system.
  2958.       2.   Always load "Fastopen"  - The default settings are fine -
  2959.            just add the line "fastopen C:" to your AUTOEXEC.BAT file.
  2960.       3.   Use a Disk Cacheing system - The more memory you can
  2961.            allocate to it the better. Easy Software recommends
  2962.            PC-Cache from Centre Point with 2 Megabytes of expanded
  2963.            memory allocated. Smartdrive (Version supplied with
  2964.            Windows 3.1) was slightly faster but caused widespread
  2965.            disk corruptions during test "Power Failures".
  2966.       4.   Do not run any TSR programs (Especially Virus Checkers).
  2967.       Procedure Code.
  2968.       Avoid making calculations and derivations within "For" loops in
  2969.       procedures.
  2970.       If, for example, you had a form in which was recorded the
  2971.       length, breadth and depth of various blocks and you knew that
  2972.       at some point you would write a procedure which listed their
  2973.       volume. Add a field for volume to the form and derive it from
  2974.       the other fields. When you write the procedure you will simply
  2975.       list this field. If the field had not been added to the form
  2976.       then you would have to calculate its value on each iteration of
  2977.       the "For" loop.
  2978.       The time taken to derive each individual "Volume" field during
  2979.       record entry will not be noticeable but the time taken to
  2980.       derive the volume for every record during the procedure will.
  2981.       Keep "Running statistics".  If your program requires statistics
  2982.       derived from many hundreds or even thousands of records then
  2983.       having to wait for a procedure which calculates them each time
  2984.       you want up to date figures is a real pain.
  2985.       To keep "running statistics" create a form with a field for
  2986.       each statistic you require and enter a single record with zero
  2987.       values in each field. Make all entries, modifications and
  2988.       deletions to your data via procedures and you can update your
  2989.       statistics each time a record is added, modified or deleted.
  2990.       Example on next page.
  2991.                                 - 75 -
  2992. ................................................................................
  2993.       MAXIMIZING SPEED                            
  2994. MAXIMIZING SPEED
  2995.       The following procedure code enters a record (collected via the
  2996.       input screen) to a purchases ledger and updates statistics used
  2997.       in the profit and loss account. It also updates the balance for
  2998.       the suppliers account.
  2999.       pause off : Escape off
  3000.       for purchases new record
  3001.          copy all from input
  3002.       next
  3003.       for stats
  3004.          if input.type = "Invoice" then
  3005.             stats.creditors = stats.creditors + input.amount
  3006.          end if
  3007.          if input.type = "CreditNote" then
  3008.             stats.creditors = stats.creditors - input.amount
  3009.          end if
  3010.          if input.type = "Payment" then
  3011.             stats.creditors = stats.creditors - input.amount
  3012.             if input.paidby = "cash" then
  3013.                stats.cashbalance = stats.cashbalance - input.amount
  3014.             else
  3015.                stats.bankbalance = stats.bankbalance - input.amount
  3016.             end if
  3017.          end if
  3018.       next
  3019.       for ACbalances with supplier = input supplier
  3020.          if input.type = "Invoice" then
  3021.             ACbalances.balance = ACbalances.balance + input.amount
  3022.          else
  3023.             ACbalances.balance = ACbalances.balance - input.amount
  3024.          end if
  3025.       next
  3026.       Whenever you need to know statistics for "Debtors", "Cash
  3027.       Balance" etc you can produce them instantly with a procedure
  3028.       which simply lists data from the statistics forms.
  3029.       Whenever you use running statistics in this way you should also
  3030.       create a procedure which does calculate them from the raw data.
  3031.       If you ever, for one reason or another, have to edit data
  3032.       directly in "Data entry" then your "running statistics" will no
  3033.       longer be accurate. You can run this procedure to correct them.
  3034.                                 - 76 -
  3035. ................................................................................
  3036.       MULTIPLE COLUMNS                            
  3037. MULTIPLE COLUMNS
  3038.       You may occasionally need to list data in order but in more
  3039.       than one column. Indexes for technical manuals are a common
  3040.       example. It would be nice if you could send the printer head
  3041.       back to the top of the page for each column but you can't. You
  3042.       must therefore get all the data for each horizontal line into
  3043.       memory at the same time and then print it.
  3044.       The following example prints the "Title" field from a "Films"
  3045.       form in alphabetic order in two columns with fifty lines on
  3046.       each page. To do this a field "No" is added to the form. This
  3047.       is an integer field and it is indexed.
  3048.       declare output fields
  3049.          films.title : righttitle
  3050.       end
  3051.       declare variables
  3052.          x as number  : y as number : lasttitle as text
  3053.       end
  3054.       '................UPDATE THE No FIELD......
  3055.       for films with title in order
  3056.          y = total records
  3057.          x = x + 1
  3058.          display status "Updating No field record" + x + "of" + y
  3059.          films.No = x
  3060.          update record
  3061.       next
  3062.       '.................PRINT IN TWO COLUMNS.................
  3063.       x = 0                        'reuse x as counter
  3064.       do
  3065.          for films with title > lasttitle
  3066.             x = x + 1
  3067.             for films alias col2 with No = films.No + 50
  3068.               righttitle = col2.title
  3069.             next
  3070.             print list items
  3071.             lasttitle = righttitle : righttitle = blank
  3072.             if mod(x,50) = 0 then
  3073.                page feed : Exit for
  3074.             end if
  3075.          next
  3076.          if lasttitle = blank then exit do
  3077.       loop
  3078.       ........................Format..................
  3079.       .list items
  3080.             { Films.title field  }      {  Righttitle Field  }
  3081.       .end
  3082.                                 - 77 -
  3083. ................................................................................
  3084.       Printing System Val.                        Printing System Val.
  3085.       In Easy Base procedures most system values are supplied as
  3086.       fields and can be declared as output fields. Others are
  3087.       internal values and cannot.
  3088.       The internal values are:-
  3089.       System Date
  3090.       System Time
  3091.       Pi
  3092.       Terminal Number
  3093.       To print an internal value you must declare an ad hoc field and
  3094.       transfer the system value to it.
  3095.       Declare output fields
  3096.          date
  3097.       end
  3098.       date = system date
  3099.                                 - 78 -
  3100. ................................................................................
  3101.       Q AND A INPUT SCREEN                        Q AND A INPUT SCREEN
  3102.       If, for a procedure you have to collect many items of data via
  3103.       an input screen, then presenting all the fields and their
  3104.       labels at once can be confusing to an operator.  You can start
  3105.       with an empty screen other than the first field and its prompt
  3106.       then have each subsequent prompt "Pop up" when the previous
  3107.       field has been filled.
  3108.       To do this you make all your input fields without a background
  3109.       (Text, Alt1 or Alt2) and you create fields for the prompts
  3110.       which have no user entry and also show no background.
  3111.       Ex.
  3112.       To collect data for paymethod, customer, and amount lay out the
  3113.       following fields:-
  3114.               Enter Method of payment....     { Paymethod Field }
  3115.               { Pop1 Field               }    { Customer Field  }
  3116.               { Pop2 Field               }    { Amount Field   }
  3117.       The "Pop1" field is derived:-
  3118.          If(Pop1 = blank and paymethod = blank,blank,"Enter Customers
  3119.                  name.........")
  3120.       and the "Pop2" field is derived:-
  3121.          If(Pop2 = blank and customer = blank,blank,"Enter Amount...
  3122.                 ...............")
  3123.                                 - 79 -
  3124. ................................................................................
  3125.       RUNTIME AUTO START                          
  3126. RUNTIME AUTO START
  3127.       If you intend to distribute an application using the Easy Base
  3128.       Runtime Module, you can have the module start automatically on
  3129.       a particular user menu by giving that menu the sign on password
  3130.       "Autostart".
  3131.       Each time the runtime module starts it searches for a menu with
  3132.       this password. If it finds one, it skips the sign on screen and
  3133.       starts automatically on this menu.
  3134.       The "Autostart" password has no significance while developing
  3135.       in Easy Base. It is treated as any other sign on password.
  3136.                                 - 80 -
  3137. ................................................................................
  3138.       SET SYSTEM VALUES                           
  3139. SET SYSTEM VALUES
  3140.       The System values System date, System Time and Output can be
  3141.       set within procedure code.
  3142.       Ex.
  3143.          System Date = input.date
  3144.       Ex.
  3145.          If input.print = "Yes" then Output = "Printer"
  3146.       Setting the output from an input screen field means that the
  3147.       user can change the output destination without having to exit
  3148.       back to the menu in procedures which have repeating input
  3149.       screens.
  3150.       If you have several procedures which are individually run to
  3151.       the screen but you also wish to batch execute them to the
  3152.       printer, you can achieve this by including the line:-
  3153.          If Global number = 2 then output = "Printer"
  3154.       then placing the procedures on a batch execute menu which
  3155.       begins with a procedure setting Global Number to 2. and ends
  3156.       with one re setting it to zero.
  3157.                                 - 81 -
  3158. ................................................................................
  3159.       TABULATION                                  
  3160. TABULATION
  3161.       To create a printout in which fields are enclosed within a
  3162.       lined table use the linedrawing facility in the format editor
  3163.       to create a page header and page footer containing the top and
  3164.       bottom of the table and insert only the vertical lines between
  3165.       the fields in the list items section.
  3166.       Ex.
  3167.       Declare output fields
  3168.          stock.name : stock.price
  3169.       end
  3170.       print page header
  3171.       for stock with name in order
  3172.          if bottom margin < 0.7 then
  3173.             print page footer
  3174.             page feed
  3175.             print page header
  3176.          end if
  3177.          print list items
  3178.       next
  3179.       print page footer
  3180.       Page feed
  3181.       ........................format.........................
  3182.       .page header
  3183.             
  3184.             
  3185.  Name               
  3186.   Price        
  3187.             
  3188.       .list items
  3189.             
  3190.  {Name Field     }  
  3191.  {Price Fld. } 
  3192.       .page footer
  3193.             
  3194.       .end
  3195.                                 - 82 -
  3196. ................................................................................
  3197.       TOTALS & SUB TOTALS                         
  3198. TOTALS & SUB TOTALS
  3199.       To produce totals and sub totals in printouts use ad hoc fields
  3200.       to hold the values and increment them during each iteration of
  3201.       the output loops. The following code lists all entries in a
  3202.       clients time sheet form with the cost of work in hand totalled
  3203.       and sub totalled for each client.
  3204.       Declare output fields
  3205.         Clients.Name:Timesheet.Hrs:Timesheet.Mins:Timesheet.Amount
  3206.         Timesheet.date : Subtotal : Grandtotal
  3207.       end
  3208.       Print Report Header
  3209.       for Clients with name in order
  3210.          Print Group Header
  3211.          Subtotal = 0
  3212.          For Timesheet with Acno = Clients.Acno
  3213.             Subtotal = Subtotal + timesheet.amount
  3214.             Grandtotal = Grandtotal + Timesheet.amount
  3215.             Print List Items
  3216.          next
  3217.          Print Group Footer
  3218.       next
  3219.       Print report footer
  3220.       .......................Output Format.........................
  3221.       .Report Header
  3222.          
  3223.                    Work in Hand Totalled by Client
  3224.          
  3225.       .Group Header
  3226.          
  3227.       .List Items
  3228.             
  3229.       
  3230. Mins                     
  3231.       .Group Footer
  3232.                                                        
  3233.           Total for 
  3234.                  
  3235.                                                        
  3236.       .Report Footer
  3237.          
  3238.          Total Work In Hand                            
  3239.          
  3240.       .end
  3241.       The field in the Group Header is Clients.name
  3242.       The fields in List Items are Timesheet.date, Timesheet.Hrs,
  3243.       Timesheet.Mins and Timesheet.amount.
  3244.       The fields in Group Footer are Clients.name and Subtotal.
  3245.       The field in Report Footer is Grandtotal.
  3246.                                 - 83 -
  3247. ................................................................................
  3248.